From a0991d38a37a118955b7e84b4fcfc2571058924c Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Tue, 23 Jan 2024 23:41:11 +0800 Subject: Update configuration --- .gitconfig | 4 ++-- .vim/after/plugin/yegappan-lsp.vim | 39 ++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.gitconfig b/.gitconfig index 66b9899..8090131 100644 --- a/.gitconfig +++ b/.gitconfig @@ -26,8 +26,8 @@ co = checkout st = status stsb = status --short --branch - df = diff --color-words - dfc = diff --color-words --cached + df = diff + dfc = diff --cached dt = difftool mt = mergetool 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