diff options
-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 |