]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/plugin/lsp.vim
Move to vim9script
[dotfiles.git] / vim / .vim / plugin / lsp.vim
index c7930b4e24cba965045381963e153cb155d71936..1f5586b3c4b9558c3f1cd9d2a674efea5a74a743 100644 (file)
@@ -1,22 +1,29 @@
-if exists("*<SID>on_lsp_buffer_enabled") | finish | endif
+vim9script
 
-let g:lsp_auto_enable = 1
+# go get golang.org/x/tools/gopls@latest
+# pip install 'python-language-server[all]'
 
-let g:lsp_diagnostics_echo_cursor = 1
-let g:lsp_diagnostics_echo_delay = -1
-let g:lsp_signature_help_enabled = 0
+g:lsc_enable_autocomplete = v: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: {
+            configurationSources: ["flake8"],
+            plugins: {
+                mccabe: {enabled: v:false},
+            },
+        }},
+        enabled: v:false,
+    },
+}
+g:lsc_auto_map = {
+    GoToDefinition: "gd",
+    GoToDefinitionSplit: "<C-W>gd",
+    ShowHover: v:true,
+    Completion: "omnifunc",
+}
 
-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
-
-augroup lsp_install
-    autocmd!
-    autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
-augroup END
-
-map <F6> :call mylsp#qfpopulate()<CR>:copen<CR>
+map <F6> :LSClientAllDiagnostics<CR>