Chore: moved similar functions to a utils for actions so they dont
repeat and copy costantly. Going to have to think of a better way that consolidates it all as a lot of it overlaps
This commit is contained in:
@@ -12,12 +12,6 @@ return function(bufnr, user_opts)
|
||||
end
|
||||
end, { desc = "Run c project" })
|
||||
|
||||
-- vim.api.nvim_buf_create_user_command(bufnr, "Pythonpip", function(cmd_args)
|
||||
-- if actions.pip_install then
|
||||
-- actions.pip_install()
|
||||
-- end
|
||||
-- end, { nargs = "*", desc = "Install python packages" })
|
||||
|
||||
for key, def in pairs(opts.python.keybinds or {}) do
|
||||
if type(def.action) == "function" then
|
||||
vim.keymap.set("n", key, function()
|
||||
@@ -29,19 +23,4 @@ return function(bufnr, user_opts)
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local root = require("vern.utils").proj_root()
|
||||
if not root then
|
||||
return
|
||||
end
|
||||
local venv_dir = nil
|
||||
if vim.uv.fs_stat(root .. "/venv/bin/python") then
|
||||
venv_dir = root .. "/venv"
|
||||
elseif vim.uv.fs_stat(root .. "/.venv/bin/python") then
|
||||
venv_dir = root .. "/.venv"
|
||||
end
|
||||
if venv_dir then
|
||||
vim.env.VIRTUAL_ENV = venv_dir
|
||||
vim.env.PATH = venv_dir .. "/bin:" .. vim.env.PATH
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user