X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Flsp.vim;fp=vim%2F.vim%2Fplugin%2Flsp.vim;h=c5e1c90ac8b51cc098c98925560e42a927275523;hp=7cf4c2fbcb24e38158cfdcee0291991e5e442d7e;hb=332316f0d9ab39aa5f8365962ba2f7c785f0edd4;hpb=0830b78630b78286b34dfb6b27c008438ba9bdd9 diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index 7cf4c2f..c5e1c90 100644 --- a/vim/.vim/plugin/lsp.vim +++ b/vim/.vim/plugin/lsp.vim @@ -3,27 +3,40 @@ vim9script # go get golang.org/x/tools/gopls@latest # pip install 'python-language-server[all]' -g:lsc_enable_autocomplete = false -g:lsc_server_commands = { - c: {command: "clangd --log=error"}, - cpp: {command: "clangd --log=error"}, - go: {command: "gopls", log_level: -1}, - python: { - command: "pyls", - workspace_config: {pyls: { +var lspServers = [ + { + filetype: ["c", "cpp"], + path: "clangd", + args: ["--log=error"], + }, + { + filetype: ["go"], + path: "gopls", + syncInit: true, + }, + { + filetype: ["python"], + path: "pyls", + args: ["-v"], + syncInit: true, + workspaceConfig: {pyls: { configurationSources: ["flake8"], plugins: { mccabe: {enabled: false}, }, }}, - enabled: false, - }, -} -g:lsc_auto_map = { - GoToDefinition: "gd", - GoToDefinitionSplit: "gd", - ShowHover: true, - Completion: "omnifunc", + } +] +var lspOpts = { + ignoreMissingServer: true, + autoComplete: false, + autoHighlight: true, + autoPopulateDiags: true, + showInlayHints: true, } -map :LSClientAllDiagnostics +autocmd VimEnter * call LspAddServer(lspServers) +autocmd VimEnter * call LspOptionsSet(lspOpts) +nmap gd :LspGotoDefinition +nmap gd :vert LspGotoDefinition +nmap :lopen