Python setup

This commit is contained in:
Smaug123
2024-03-22 21:01:26 +00:00
parent 1e4c4c525f
commit 78b2d62ce2
6 changed files with 70 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
local venv_selector = require 'venv-selector'
venv_selector.setup {
--- other configuration
changed_venv_hooks = { venv_selector.hooks.pyright },
name = { "venv", ".venv" },
}
vim.api.nvim_create_autocmd('VimEnter', {
desc = 'Auto select virtualenv Nvim open',
pattern = '*',
callback = function()
local venv = vim.fn.findfile('pyproject.toml', vim.fn.getcwd() .. ';')
if venv ~= '' then
require('venv-selector').retrieve_from_cache()
end
end,
once = true,
})