mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
set up vim-language-server for vim-lsp
This commit is contained in:
parent
9f1530cdf8
commit
74e9290cb0
@ -21,7 +21,11 @@ Plug 'prabirshrestha/vim-lsp'
|
||||
Plug 'lighttiger2505/deoplete-vim-lsp'
|
||||
|
||||
" Vim source for deoplete
|
||||
Plug 'Shougo/neco-vim', { 'for': 'vim' }
|
||||
|
||||
if !executable('vim-language-server')
|
||||
" only use neco-vim when vim-language-server is not available
|
||||
Plug 'Shougo/neco-vim', { 'for': 'vim' }
|
||||
endif
|
||||
"}}
|
||||
|
||||
"{{ Python-related plugins
|
||||
@ -366,6 +370,23 @@ if executable('pyls')
|
||||
\ })
|
||||
endif
|
||||
|
||||
if executable('vim-language-server')
|
||||
augroup LspVim
|
||||
autocmd!
|
||||
autocmd User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'vim-language-server',
|
||||
\ 'cmd': {server_info->['vim-language-server', '--stdio']},
|
||||
\ 'whitelist': ['vim'],
|
||||
\ 'initialization_options': {
|
||||
\ 'vimruntime': $VIMRUNTIME,
|
||||
\ 'runtimepath': &rtp,
|
||||
\ },
|
||||
\ 'suggest': {
|
||||
\ 'fromRuntimepath': v:true
|
||||
\ }})
|
||||
augroup END
|
||||
endif
|
||||
|
||||
function! s:on_lsp_buffer_enabled() abort
|
||||
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
||||
nmap <buffer> gd <plug>(lsp-definition)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user