From 2092e78930394e9c03485dfba87ca82099fecf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 30 Sep 2019 23:10:32 +0200 Subject: [PATCH] Improved language server client config --- bundles-init/vim-lsp.cfg.vim | 42 +++++++++++++++++++++++++++-------- bundles-init/vim-lsp.load.vim | 2 ++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/bundles-init/vim-lsp.cfg.vim b/bundles-init/vim-lsp.cfg.vim index 583e363..0de0404 100644 --- a/bundles-init/vim-lsp.cfg.vim +++ b/bundles-init/vim-lsp.cfg.vim @@ -1,12 +1,10 @@ -au User lsp_setup call lsp#register_server({ - \ 'name': 'rust' , - \ 'cmd' : {server_info->[ - \ &shell, - \ &shellcmdflag, - \ 'rustup run stable rls'] - \ } , - \ 'whitelist' : [ 'rust' ] , -\ }) +let g:lsp_highlight_references_enabled = 1 +highlight lspReference ctermfg=black guifg=black ctermbg=yellow guibg=yellow + +let g:lsp_signs_enabled = 1 +let g:lsp_diagnostics_echo_cursor = 1 +let g:lsp_signs_error = {'text': '✗'} +let g:lsp_signs_warning = {'text': '‼'} noremap df :LspDocumentFormat vnoremap df :LspDocumentRangeFormat @@ -15,3 +13,29 @@ noremap :LspDefinition noremap dR :LspRename noremap dh :LspHover noremap ds :LspWorkspaceSymbol + +"----------------------------- +" CONFIGURE VARIOUS SERVERS +"----------------------------- + +" Rust +if executable('rustup') + au User lsp_setup call lsp#register_server({ + \ 'name': 'rust' , + \ 'cmd' : {server_info->[ + \ &shell, + \ &shellcmdflag, + \ 'rustup run stable rls'] + \ } , + \ 'whitelist' : [ 'rust' ] , + \ }) +endif + +" Python (requires pip install python-language-server) +if executable('pyls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'pyls', + \ 'cmd': {server_info->['pyls']}, + \ 'whitelist': ['python'], + \ }) +endif diff --git a/bundles-init/vim-lsp.load.vim b/bundles-init/vim-lsp.load.vim index 531b119..29064fd 100644 --- a/bundles-init/vim-lsp.load.vim +++ b/bundles-init/vim-lsp.load.vim @@ -1,2 +1,4 @@ +NeoBundle 'prabirshrestha/asyncomplete.vim' NeoBundle 'prabirshrestha/async.vim' NeoBundle 'prabirshrestha/vim-lsp' +NeoBundle 'prabirshrestha/asyncomplete-lsp.vim'