X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Flsp.vim;h=a342e3cfe3398e2a0075bc5fe5edd49b29dbccc3;hb=HEAD;hp=ad29aba42b37c9ccaec220714c69eb18578ebbff;hpb=b61e4073d921078f2c1d67d4cc618e859f4e7d45;p=dotfiles.git diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index ad29aba..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,14 +36,22 @@ endfor var lspOpts = { ignoreMissingServer: true, autoComplete: false, + autoHighlight: true, autoPopulateDiags: 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