fix nvim diagnostics

This commit is contained in:
Diego Fernando Carrión 2024-10-19 13:18:31 +02:00
parent 6f240beb90
commit a613894008
No known key found for this signature in database
GPG Key ID: A286B34D5CFB3404
6 changed files with 99 additions and 21 deletions

View File

@ -18,21 +18,21 @@ fi
# Editors
alias ed="ed -p': '"
if [ -x "$(command -v nvim)" ] && ! limited_terminal
then
vim_path="$(command -v vim)"
vimdiff_path="$(command -v vimdiff)"
if [ -x "$vim_path" ]
then
alias vvim="$vim_path"
fi
if [ -x "$vimdiff_path" ]
then
alias vvimdiff="$vimdiff_path"
fi
alias vim=nvim
alias vimdiff="nvim -d"
fi
# if [ -x "$(command -v nvim)" ] && ! limited_terminal
# then
# vim_path="$(command -v vim)"
# vimdiff_path="$(command -v vimdiff)"
# if [ -x "$vim_path" ]
# then
# alias vvim="$vim_path"
# fi
# if [ -x "$vimdiff_path" ]
# then
# alias vvimdiff="$vimdiff_path"
# fi
# alias vim=nvim
# alias vimdiff="nvim -d"
# fi
if [[ "$(whence -b vi)" == "/usr/local/bin/ex" ]]
then
alias vi='EXINIT="$(inline_exrc $HOME/.exrc)" vi'

View File

@ -32,6 +32,10 @@ alias k=kubectl
if [ -x "$(command -v neomutt)" ]
then
if [ -x "$(command -v mutt)" ]
then
alias mmutt=mutt
fi
alias mutt=neomutt
fi
@ -64,6 +68,11 @@ then
alias title='wezterm cli set-tab-title'
fi
if [ -x "$(command -v lazygit)" ]
then
alias lg=lazygit
fi
# Local
if [ -f ~/.bash_aliases.local ]
then

View File

@ -1,6 +1,2 @@
.config/nvim/autoload
.config/nvim/colors
.config/nvim/plugged
.config/nvim/session
.config/nvim/spell
.var/tmp/nvim/
.config/nvim/after/queries/python

View File

@ -0,0 +1,15 @@
; extends
; Module docstring
(module . (expression_statement (string) @comment))
; Class docstring
(class_definition
body: (block . (expression_statement (string) @comment)))
; Function/method docstring
(function_definition
body: (block . (expression_statement (string) @comment)))
; Attribute docstring
((expression_statement (assignment)) . (expression_statement (string) @comment))

View File

@ -0,0 +1,44 @@
vim.diagnostic.config({
virtual_text = false,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
signs = true,
underline = true,
update_in_insert = true,
severity_sort = false,
})
-- Function to check if a floating dialog exists and if not
-- then check for diagnostics under the cursor
function OpenDiagnosticIfNoFloat()
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
if vim.api.nvim_win_get_config(winid).zindex then
return
end
end
-- THIS IS FOR BUILTIN LSP
vim.diagnostic.open_float(0, {
scope = "cursor",
focusable = false,
close_events = {
"CursorMoved",
"CursorMovedI",
"BufHidden",
"InsertCharPre",
"WinLeave",
},
})
end
-- Show diagnostics under the cursor when holding position
vim.api.nvim_create_augroup("lsp_diagnostics_hold", { clear = true })
vim.api.nvim_create_autocmd({ "CursorHold" }, {
pattern = "*",
command = "lua OpenDiagnosticIfNoFloat()",
group = "lsp_diagnostics_hold",
})

View File

@ -11,6 +11,7 @@ return {
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim",
"towolf/vim-helm",
},
config = function()
@ -120,7 +121,20 @@ return {
}
}
}
end
end,
helm_ls = function()
local lspconfig = require('lspconfig')
lspconfig.helm_ls.setup {
settings = {
['helm-ls'] = {
yamlls = {
enabled = false,
-- path = "yaml-language-server",
}
}
}
}
end,
}
})