🛠️ Installation
- 💤 Lazy.nvim
- 📦 Packer
- 🔌 vim-plug
- 📋 paq-nvim
- ⚡ dein.vim
- 📦 minpac
{
"linux-cultist/venv-selector.nvim",
dependencies = {
"neovim/nvim-lspconfig",
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } }, -- optional: you can also use fzf-lua, snacks, mini-pick instead.
},
ft = "python", -- Load when opening Python files
keys = {
{ ",v", "<cmd>VenvSelect<cr>" }, -- Open picker on keymap
},
opts = { -- this can be an empty lua table - just showing below for clarity.
search = {}, -- if you add your own searches, they go here.
options = {} -- if you add plugin options, they go here.
},
},
use {
"linux-cultist/venv-selector.nvim",
ft = { "python" }, -- load only for Python files
requires = {
"neovim/nvim-lspconfig",
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } }, -- optional: you can also use fzf-lua, snacks, mini-pick instead.
},
config = function()
require("venv-selector").setup({
search = {}, -- if you add your own searches, they go here.
options = {} -- if you add plugin options, they go here.
})
vim.keymap.set("n", ",v", "<cmd>VenvSelect<cr>", { desc = "Select Python venv" })
end,
}
" deps
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/plenary.nvim'
" optional: you can also use fzf-lua, snacks, mini-pick instead.
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
" plugin, lazy-load for Python
Plug 'linux-cultist/venv-selector.nvim', { 'for': 'python' }
" after PlugInstall, add in init.lua/init.vim:
lua << EOF
vim.keymap.set("n", ",v", "<cmd>VenvSelect<cr>", { desc = "Select Python venv" })
require("venv-selector").setup({ search = {}, options = {} })
EOF
require "paq" {
"neovim/nvim-lspconfig";
"nvim-lua/plenary.nvim";
{ "nvim-telescope/telescope.nvim", branch = "0.1.x" }; -- optional: you can also use fzf-lua, snacks, mini-pick instead.
"linux-cultist/venv-selector.nvim";
}
-- lazy-load via autocmd for Python
vim.api.nvim_create_autocmd("FileType", {
pattern = "python",
callback = function()
require("venv-selector").setup({ search = {}, options = {} })
end,
})
vim.keymap.set("n", ",v", "<cmd>VenvSelect<cr>", { desc = "Select Python venv" })
call dein#add('neovim/nvim-lspconfig')
call dein#add('nvim-lua/plenary.nvim')
call dein#add('nvim-telescope/telescope.nvim', {'rev': '0.1.x'})
" Lazy-load on Python
call dein#add('linux-cultist/venv-selector.nvim', {'on_ft': ['python']})
" Config
lua << EOF
vim.keymap.set("n", ",v", "<cmd>VenvSelect<cr>", { desc = "Select Python venv" })
require("venv-selector").setup({ search = {}, options = {} })
EOF
packadd minpac
call minpac#init()
call minpac#add('neovim/nvim-lspconfig')
call minpac#add('nvim-lua/plenary.nvim')
call minpac#add('nvim-telescope/telescope.nvim') " branch pin not supported; pin via commit if needed
call minpac#add('linux-cultist/venv-selector.nvim')
" Lazy-load via autocmd
augroup VenvSelectorPython
autocmd!
autocmd FileType python lua require("venv-selector").setup({ search = {}, options = {} })
augroup END
lua << EOF
vim.keymap.set("n", ",v", "<cmd>VenvSelect<cr>", { desc = "Select Python venv" })
EOF
Running it
Run the :VenvSelect
command inside neovim.