add venv selector

This commit is contained in:
Johannes Knopp
2024-12-21 23:51:06 +01:00
parent f7120df53b
commit d9ca06e58f
5 changed files with 77 additions and 29 deletions

View File

@ -85,16 +85,30 @@ return {
end,
['pyright'] = function()
lspconfig['pyright'].setup({
capabilities = capabilities,
cmd = { "pyright-langserver", "--stdio" },
filetypes = { "python" },
-- root_dir = function(filename)
-- return util.root_pattern(unpack(root_files))(filename) or util.path.dirname(filename)
-- end,
settings = {
python = {
analysis = {
useLibraryCodeForTypes = true,
typeCheckingMode = "basic",
configPath = vim.fn.expand('./pyrightconfig.json')
autoSearchPaths = true,
diagnosticMode = "workspace",
useLibraryCodeForTypes = true
}
}
}
-- capabilities = capabilities,
-- settings = {
-- python = {
-- analysis = {
-- useLibraryCodeForTypes = true,
-- typeCheckingMode = "basic",
-- -- configPath = vim.fn.expand('./pyrightconfig.json')
-- }
-- }
-- },
})
end,
})

View File

@ -0,0 +1,24 @@
return {
"linux-cultist/venv-selector.nvim",
dependencies = {
"neovim/nvim-lspconfig",
-- "mfussenegger/nvim-dap", "mfussenegger/nvim-dap-python", --optional
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
},
lazy = false,
branch = "regexp", -- This is the regexp branch, use this for the new version
config = function()
require("venv-selector").setup({
-- settings = {
-- search = {
-- my_envs = {
-- command = "fd python$ ~/git/cerenim/backend/"
-- }
-- }
-- }
})
end,
keys = {
{ ",v", "<cmd>VenvSelect<cr>" },
},
}