From a0991d38a37a118955b7e84b4fcfc2571058924c Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Tue, 23 Jan 2024 23:41:11 +0800 Subject: Update configuration --- .vim/after/plugin/yegappan-lsp.vim | 39 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to '.vim') diff --git a/.vim/after/plugin/yegappan-lsp.vim b/.vim/after/plugin/yegappan-lsp.vim index 1f1ef45..3c1a9dc 100644 --- a/.vim/after/plugin/yegappan-lsp.vim +++ b/.vim/after/plugin/yegappan-lsp.vim @@ -1,23 +1,26 @@ packadd yegappan-lsp -" Go language server -call LspAddServer([#{ - \ name: 'golang', - \ filetype: ['go', 'gomod'], - \ omnicompl: v:true, - \ path: exepath('gopls'), - \ args: ['serve'], - \ syncInit: v:true - \ }]) - -call LspAddServer([#{ - \ name: 'ruby', - \ filetype: ['ruby'], - \ omnicompl: v:true, - \ path: exepath('solargraph'), - \ args: ['stdio'], - \ syncInit: v:true - \ }]) +if executable('gopls') + call LspAddServer([#{ + \ name: 'golang', + \ filetype: ['go', 'gomod'], + \ omnicompl: v:true, + \ path: exepath('gopls'), + \ args: ['serve'], + \ syncInit: v:true + \ }]) +endif + +if executable('solargraph') + call LspAddServer([#{ + \ name: 'ruby', + \ filetype: ['ruby'], + \ omnicompl: v:true, + \ path: exepath('solargraph'), + \ args: ['stdio'], + \ syncInit: v:true + \ }]) +endif call LspOptionsSet(#{ \ aleSupport: v:true, -- cgit v1.2.3