X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Flsp.vim;h=1f5586b3c4b9558c3f1cd9d2a674efea5a74a743;hb=9cbfa59ca421fac5422cbf0c2c52f48f8f2adb4c;hp=621548b542491a19c5fe41be7b5dcf0879840375;hpb=abeca38b2bf8282f0ad673286bc51fbaf59d27f2;p=dotfiles.git diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index 621548b..1f5586b 100644 --- a/vim/.vim/plugin/lsp.vim +++ b/vim/.vim/plugin/lsp.vim @@ -1,19 +1,29 @@ -let g:asyncomplete_auto_completeopt = 0 -let g:asyncomplete_auto_popup = 0 -imap (asyncomplete_force_refresh) +vim9script -let g:lsp_highlight_references_enabled = 1 -let g:lsp_diagnostics_echo_cursor = 1 -let g:lsp_diagnostics_echo_delay = -1 +# go get golang.org/x/tools/gopls@latest +# pip install 'python-language-server[all]' -function! s:on_lsp_buffer_enabled() abort - nmap [g (lsp-previous-diagnostic) - nmap ]g (lsp-next-diagnostic) - nmap gd (lsp-definition) - nmap K (lsp-hover) -endfunction +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: "gd", + ShowHover: v:true, + Completion: "omnifunc", +} -augroup lsp_install - autocmd! - autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() -augroup END +map :LSClientAllDiagnostics