diff options
| author | jdhao <jdhao@hotmail.com> | 2020-11-04 02:28:50 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2020-11-04 02:28:50 +0800 |
| commit | 74e9290cb04aa906f99806861a57513ea67a5f25 (patch) | |
| tree | aecf6d458dcd9b3198004e2442d40b74bd3efa08 | |
| parent | 9f1530cdf8a6f0cca1b97818330385a6405ff9a8 (diff) | |
set up vim-language-server for vim-lsp
| -rw-r--r-- | core/plugins.vim | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/core/plugins.vim b/core/plugins.vim index ca23b16..15b4da1 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -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) |
