mirror of
https://github.com/Smaug123/nix-dotfiles
synced 2025-10-10 17:08:40 +00:00
Python setup
This commit is contained in:
19
home-manager/nvim/venv-selector.lua
Normal file
19
home-manager/nvim/venv-selector.lua
Normal 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,
|
||||
})
|
Reference in New Issue
Block a user