X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Flsp.vim;h=1928046941157257f7e6d251d1b51478a863ada6;hb=HEAD;hp=41791c985d730b7a20d76fbbb181cf0bfb407735;hpb=13ebb247c317e1c491b1a1726f7005360e304ba9;p=dotfiles.git diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index 41791c9..a342e3c 100644 --- a/vim/.vim/plugin/lsp.vim +++ b/vim/.vim/plugin/lsp.vim @@ -1,18 +1,18 @@ vim9script # go get golang.org/x/tools/gopls@latest -# pip install 'python-language-server[all]' +# pip install "python-language-server[all]" var lspServers: list> for d in [ { - filetype: ["c", "cpp"], + filetype: ["c", "ch", "cpp"], path: "clangd", args: ["--log=error"], }, { - filetype: ["go"], + filetype: ["go", "gomod"], path: "gopls", syncInit: true, }, @@ -36,13 +36,22 @@ endfor var lspOpts = { ignoreMissingServer: true, autoComplete: false, + autoHighlight: true, autoPopulateDiags: true, - showInlayHints: true, + + # Lint warning only on status line, do not show near cursor + showDiagInPopup: false, + showDiagOnStatusLine: true, + showSignature: false, } +set omnifunc=g:LspOmniFunc autocmd VimEnter * call LspAddServer(lspServers) autocmd VimEnter * call LspOptionsSet(lspOpts) +autocmd CursorMoved * silent! LspDiagCurrent nmap gd :LspGotoDefinition nmap gd :vert LspGotoDefinition nmap :lopen +nmap [l :LspDiagPrev +nmap ]l :LspDiagNext