vim9script # go get golang.org/x/tools/gopls@latest # pip install "python-language-server[all]" var lspServers: list> for d in [ { filetype: ["c", "ch", "cpp"], path: "clangd", args: ["--log=error"], }, { filetype: ["go", "gomod"], path: "gopls", syncInit: true, }, { filetype: ["python"], path: "pyls", syncInit: true, workspaceConfig: {pyls: { configurationSources: ["flake8"], plugins: { mccabe: {enabled: false}, }, }}, }, ] if executable(d["path"]) add(lspServers, d) endif 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