]> Sergey Matveev's repositories - dotfiles.git/commitdiff
I use github.com/yegappan/lsp now
authorSergey Matveev <stargrave@stargrave.org>
Tue, 31 Jan 2023 14:32:42 +0000 (17:32 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 31 Jan 2023 14:32:42 +0000 (17:32 +0300)
vim/.vim/ftplugin/python/lsp.vim [deleted file]
vim/.vim/plugin/lsp.vim

diff --git a/vim/.vim/ftplugin/python/lsp.vim b/vim/.vim/ftplugin/python/lsp.vim
deleted file mode 100644 (file)
index cd34fa5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-if executable("pyls")
-    LSClientEnable
-endif
index 7cf4c2fbcb24e38158cfdcee0291991e5e442d7e..c5e1c90ac8b51cc098c98925560e42a927275523 100644 (file)
@@ -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: "<C-W>gd",
-    ShowHover: true,
-    Completion: "omnifunc",
+    }
+]
+var lspOpts = {
+    ignoreMissingServer: true,
+    autoComplete: false,
+    autoHighlight: true,
+    autoPopulateDiags: true,
+    showInlayHints: true,
 }
 
-map <F6> :LSClientAllDiagnostics<CR>
+autocmd VimEnter * call LspAddServer(lspServers)
+autocmd VimEnter * call LspOptionsSet(lspOpts)
+nmap gd :LspGotoDefinition<CR>
+nmap <C-W>gd :vert LspGotoDefinition<CR>
+nmap <F6> :lopen<CR>