-function! s:on_lsp_buffer_enabled() abort
- setlocal omnifunc=lsp#complete
- nmap <buffer> [g <Plug>(lsp-previous-diagnostic)
- nmap <buffer> ]g <Plug>(lsp-next-diagnostic)
- nmap <buffer> gd <plug>(lsp-definition)
- nmap <buffer> K <plug>(lsp-hover)
-endfunction
+for d in [
+ {
+ filetype: ["c", "cpp"],
+ path: "clangd",
+ args: ["--log=error"],
+ },
+ {
+ filetype: ["go"],
+ 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