From 74e9290cb04aa906f99806861a57513ea67a5f25 Mon Sep 17 00:00:00 2001 From: jdhao Date: Wed, 4 Nov 2020 02:28:50 +0800 Subject: [PATCH] set up vim-language-server for vim-lsp --- core/plugins.vim | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 gd (lsp-definition)