Use vim-lsp-settings instead of manual config

This commit is contained in:
Emmanuel BENOîT 2020-12-02 21:37:41 +01:00
parent 1623b2a3e8
commit fd9ca401c4
2 changed files with 1 additions and 42 deletions

View file

@ -0,0 +1 @@
NeoBundle 'mattn/vim-lsp-settings'

View file

@ -13,45 +13,3 @@ 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
" C/C++ through Clangd
if executable('clangd')
augroup lsp_clangd
autocmd!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'clangd',
\ 'cmd': {server_info->['clangd']},
\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
\ })
autocmd FileType c setlocal omnifunc=lsp#complete
autocmd FileType cpp setlocal omnifunc=lsp#complete
autocmd FileType objc setlocal omnifunc=lsp#complete
autocmd FileType objcpp setlocal omnifunc=lsp#complete
augroup end
endif