]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/plugin/lsp.vim
Enable pyls only if it exists
[dotfiles.git] / vim / .vim / plugin / lsp.vim
index f951f3697eb5dcccad617782fb07456fb16322b7..7b6d4eadefc902b87958547b634c0d81bb3cfa5e 100644 (file)
@@ -1,19 +1,27 @@
-let g:asyncomplete_auto_completeopt = 0
-let g:asyncomplete_auto_popup = 0
+" go get golang.org/x/tools/gopls@latest
+" pip install 'python-language-server[all]'
 
-let g:lsp_highlight_references_enabled = 1
-let g:lsp_diagnostics_echo_cursor = 1
-let g:lsp_diagnostics_echo_delay = -1
+let g:lsc_enable_autocomplete = v:false
+let g:lsc_server_commands = {
+    \ "c": {"command": "clangd --log=error"},
+    \ "cpp": {"command": "clangd --log=error"},
+    \ "go": {"command": "gopls", "log_level": "Error"},
+    \ "python": {
+    \     "command": "pyls",
+    \     "workspace_config": {"pyls": {
+    \         "configurationSources": ["flake8"],
+    \         "plugins": {
+    \             "mccabe": {"enabled": v:false},
+    \         },
+    \     }},
+    \     "enabled": v:false,
+    \ },
+\ }
+let 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> :LSClientAllDiagnostics<CR>