X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Flsp.vim;h=7b6d4eadefc902b87958547b634c0d81bb3cfa5e;hb=78d4336b677292747a6f7f06071c1f0eb5af4a53;hp=c7930b4e24cba965045381963e153cb155d71936;hpb=6b3cd1e80646e11ce56a53ccd15cb0b674dac88f;p=dotfiles.git diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index c7930b4..7b6d4ea 100644 --- a/vim/.vim/plugin/lsp.vim +++ b/vim/.vim/plugin/lsp.vim @@ -1,22 +1,27 @@ -if exists("*on_lsp_buffer_enabled") | finish | endif +" go get golang.org/x/tools/gopls@latest +" pip install 'python-language-server[all]' -let g:lsp_auto_enable = 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": "gd", + \ "ShowHover": v:true, + \ "Completion": "omnifunc", +\ } -let g:lsp_diagnostics_echo_cursor = 1 -let g:lsp_diagnostics_echo_delay = -1 -let g:lsp_signature_help_enabled = 0 - -function! s:on_lsp_buffer_enabled() abort - setlocal omnifunc=lsp#complete - nmap [g (lsp-previous-diagnostic) - nmap ]g (lsp-next-diagnostic) - nmap gd (lsp-definition) - nmap K (lsp-hover) -endfunction - -augroup lsp_install - autocmd! - autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() -augroup END - -map :call mylsp#qfpopulate():copen +map :LSClientAllDiagnostics