[cd] eval .localrc [neovim] omit lsp autocmds when env set so

This commit is contained in:
Piotr Domański 2024-10-16 16:55:16 +02:00
parent 424dd161c1
commit 58bdfd856c
2 changed files with 19 additions and 11 deletions

View file

@ -2,7 +2,10 @@ vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
vim.api.nvim_create_autocmd("LspAttach", {
local nvim_lsp_omit_dir = os.getenv("NVIM_LSP_OMIT_DIR")
if not nvim_lsp_omit_dir then
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
callback = function(args)
vim.api.nvim_create_autocmd("BufWritePre", {
@ -12,4 +15,5 @@ vim.api.nvim_create_autocmd("LspAttach", {
end,
})
end
})
})
end

View file

@ -20,6 +20,10 @@ function cd
source .venv/bin/activate
fi
if [ -f .localrc ]; then
source .localrc
fi
if [ $# -gt 1 ]; then
if [ -f Makefile ]; then
make ${@:2}