]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/plugin/lsp.vim
Unneeded args
[dotfiles.git] / vim / .vim / plugin / lsp.vim
1 vim9script
2
3 # go get golang.org/x/tools/gopls@latest
4 # pip install 'python-language-server[all]'
5
6 var lspServers = [
7     {
8         filetype: ["c", "cpp"],
9         path: "clangd",
10         args: ["--log=error"],
11     },
12     {
13         filetype: ["go"],
14         path: "gopls",
15         syncInit: true,
16     },
17     {
18         filetype: ["python"],
19         path: "pyls",
20         syncInit: true,
21         workspaceConfig: {pyls: {
22             configurationSources: ["flake8"],
23             plugins: {
24                 mccabe: {enabled: false},
25             },
26         }},
27     }
28 ]
29 var lspOpts = {
30     ignoreMissingServer: true,
31     autoComplete: false,
32     autoHighlight: true,
33     autoPopulateDiags: true,
34     showInlayHints: true,
35 }
36
37 autocmd VimEnter * call LspAddServer(lspServers)
38 autocmd VimEnter * call LspOptionsSet(lspOpts)
39 nmap gd :LspGotoDefinition<CR>
40 nmap <C-W>gd :vert LspGotoDefinition<CR>
41 nmap <F6> :lopen<CR>