Improved language server client config

This commit is contained in:
Emmanuel BENOîT 2019-09-30 23:10:32 +02:00
parent 00feff296f
commit 2092e78930
2 changed files with 35 additions and 9 deletions

View file

@ -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 <Leader>df :LspDocumentFormat<cr>
vnoremap <Leader>df :LspDocumentRangeFormat<cr>
@ -15,3 +13,29 @@ noremap <F3> :LspDefinition<cr>
noremap <Leader>dR :LspRename<cr>
noremap <Leader>dh :LspHover<cr>
noremap <Leader>ds :LspWorkspaceSymbol<cr>
"-----------------------------
" 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

View file

@ -1,2 +1,4 @@
NeoBundle 'prabirshrestha/asyncomplete.vim'
NeoBundle 'prabirshrestha/async.vim'
NeoBundle 'prabirshrestha/vim-lsp'
NeoBundle 'prabirshrestha/asyncomplete-lsp.vim'