vim9script
# go get golang.org/x/tools/gopls@latest
-# pip install 'python-language-server[all]'
+# pip install "python-language-server[all]"
var lspServers: list<dict<any>>
for d in [
{
- filetype: ["c", "cpp"],
+ filetype: ["c", "ch", "cpp"],
path: "clangd",
args: ["--log=error"],
},
{
- filetype: ["go"],
+ filetype: ["go", "gomod"],
path: "gopls",
syncInit: true,
},
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<CR>
nmap <C-W>gd :vert LspGotoDefinition<CR>
nmap <F6> :lopen<CR>
+nmap [l :LspDiagPrev<CR>
+nmap ]l :LspDiagNext<CR>