Something went wrong. Try again.
Vim/Neovim configurations just for me
neovim
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334local M = {}
local VENV_DIR = { ".venv" }
function M.set_env() if vim.env.VIRTUAL_ENV then return true end
local venv_dir = vim.fs.find(VENV_DIR, { upward = true, stop = vim.uv.os_homedir(), path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), type = "directory", })[1] if not venv_dir then return false end
local bin_dir = venv_dir .. "/bin" local path_sep = ":" if package.config:sub(1, 1) == "\\" then bin_dir = venv_dir .. "/Scripts" path_sep = ";" end
vim.env.VIRTUAL_ENV = venv_dir vim.env.VIRTUAL_ENV_PROMPT = vim.fs.basename(venv_dir) vim.env.PATH = bin_dir .. path_sep .. vim.env.PATH return trueend
return M