From 332316f0d9ab39aa5f8365962ba2f7c785f0edd4 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 31 Jan 2023 17:32:42 +0300 Subject: [PATCH] I use github.com/yegappan/lsp now --- vim/.vim/ftplugin/python/lsp.vim | 3 -- vim/.vim/plugin/lsp.vim | 47 ++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 20 deletions(-) delete mode 100644 vim/.vim/ftplugin/python/lsp.vim diff --git a/vim/.vim/ftplugin/python/lsp.vim b/vim/.vim/ftplugin/python/lsp.vim deleted file mode 100644 index cd34fa5..0000000 --- a/vim/.vim/ftplugin/python/lsp.vim +++ /dev/null @@ -1,3 +0,0 @@ -if executable("pyls") - LSClientEnable -endif 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 -- 2.44.0