Skip to content

Instantly share code, notes, and snippets.

@ashemedai
Last active October 25, 2024 14:18
Show Gist options
  • Select an option

  • Save ashemedai/2e19cbe5ccfe7fd5adc1424ccd90afa3 to your computer and use it in GitHub Desktop.

Select an option

Save ashemedai/2e19cbe5ccfe7fd5adc1424ccd90afa3 to your computer and use it in GitHub Desktop.
Neovim provider configuration with version managers
-- Set up Python virtualenv if it exists
-- Order of preference: uv, pyenv
if vim.fn.isdirectory(vim.fn.expand("~/.virtualenvs/neovim/bin")) == 1 then
vim.g.python3_host_prog = vim.fn.expand("~/.virtualenvs/neovim/bin/python")
elseif vim.fn.isdirectory(vim.fn.expand("~/.pyenv/versions/neovim/bin")) == 1 then
vim.g.python3_host_prog = vim.fn.expand("~/.pyenv/versions/neovim/bin/python")
end
-- Set up appropriate neovim-node-host
-- Order of preference: fnm, nvm
if os.getenv("FNM_DIR") ~= nil then
vim.g.node_host_prog = vim.fn.expand(os.getenv("FNM_DIR") .. "/aliases/lts-latest/bin/neovim-node-host")
elseif os.getenv("NVM_BIN") ~= nil then
vim.g.node_host_prog = vim.fn.expand(os.getenv("NVM_BIN") .. "/neovim-node-host")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment