From 6dedd2f7bc4ecd61dff17592deed45c4da7ae9e8 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Mon, 22 Jan 2024 22:06:59 +0800 Subject: Update lsp config --- .vim/after/plugin/yegappan-lsp.vim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to '.vim/after') diff --git a/.vim/after/plugin/yegappan-lsp.vim b/.vim/after/plugin/yegappan-lsp.vim index 42bb6cf..1f1ef45 100644 --- a/.vim/after/plugin/yegappan-lsp.vim +++ b/.vim/after/plugin/yegappan-lsp.vim @@ -10,22 +10,34 @@ call LspAddServer([#{ \ syncInit: v:true \ }]) +call LspAddServer([#{ + \ name: 'ruby', + \ filetype: ['ruby'], + \ omnicompl: v:true, + \ path: exepath('solargraph'), + \ args: ['stdio'], + \ syncInit: v:true + \ }]) + call LspOptionsSet(#{ - \ aleSupport: v:true, + \ aleSupport: v:true, \ autoComplete: v:false, \ omniComplete: v:true, \ completionMatcher: "fuzzy", \ }) function! s:on_lsp_attached() abort - setlocal tagfunc=lsp#lsp#TagFunc setlocal keywordprg=:LspHover " setlocal formatexpr=lsp#lsp#FormatExpr() + nnoremap gd LspGotoDefinition + nnoremap gd topleft LspGotoDefinition + nnoremap rn :LspRename nnoremap gr :LspShowReferences autocmd! BufWritePre *.rs,*.go call execute('LspFormat') + autocmd! BufRead *.go,*.rs setlocal tagfunc=lsp#lsp#TagFunc endfunction augroup lsp_attached -- cgit v1.2.3