m1chaelwilliams / my-nvim-config

My NeoVim configuration written from scratch
https://neovim.io
46 stars 0 forks source link

I came up with a better system detection #1

Open voyeg3r opened 4 hours ago

voyeg3r commented 4 hours ago

Actually I have got your code and asked chatgpt if it could figure out a concise way to get the OS and it gave me this:

function utils.get_os()
    local os_map = {
        ["Windows_NT"] = "windows",
        ["Darwin"] = "mac"
    }
    return os_map[vim.uv.os_uname().sysname] or "linux"
end
voyeg3r commented 4 hours ago

It uses vim.uv instead of vim.loop because neovim 0.10.1 uses it now