diff options
author | Guangxiong Lin <[email protected]> | 2024-01-22 22:06:59 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2024-01-22 22:06:59 +0800 |
commit | 6dedd2f7bc4ecd61dff17592deed45c4da7ae9e8 (patch) | |
tree | e2a0ad2b3116c10ec17af0b6af2cdaf474ff2347 /.vim/after/plugin/yegappan-lsp.vim | |
parent | cb7ca3805cfe41ff7ac0a74efe394f91fa5c3659 (diff) | |
download | dotfiles-6dedd2f7bc4ecd61dff17592deed45c4da7ae9e8.tar.gz dotfiles-6dedd2f7bc4ecd61dff17592deed45c4da7ae9e8.tar.bz2 dotfiles-6dedd2f7bc4ecd61dff17592deed45c4da7ae9e8.zip |
Update lsp config
Diffstat (limited to '.vim/after/plugin/yegappan-lsp.vim')
-rw-r--r-- | .vim/after/plugin/yegappan-lsp.vim | 16 |
1 files changed, 14 insertions, 2 deletions
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 <buffer> gd <Cmd>LspGotoDefinition<CR> + nnoremap <buffer> <C-W>gd <Cmd>topleft LspGotoDefinition<CR> + nnoremap <buffer> <localleader>rn :LspRename<CR> nnoremap <buffer> gr :LspShowReferences<CR> autocmd! BufWritePre *.rs,*.go call execute('LspFormat') + autocmd! BufRead *.go,*.rs setlocal tagfunc=lsp#lsp#TagFunc endfunction augroup lsp_attached |