Browse Source

Added a few shortcuts for LanguageClient

<SPC>+] => Jump to definition
<SPC>+k => Show function documentation
<SPC>+r => Rename function/symbol
<SPC>+f => Fix suggestion
<SPC>+? => Show error explanation
master
Julio Biason 4 years ago
parent
commit
05996fcdb1
  1. 14
      nvim/init.vim

14
nvim/init.vim

@ -45,7 +45,7 @@ let g:rainbow_active = 1 " This is part of the Rainbow brackets, enabling it
" Mappings {{{ " Mappings {{{
nnoremap - :Ex<CR> nnoremap - :Ex<CR>
nnoremap <silent> <leader>c :call TrimWhiteSpace()<CR> nnoremap <silent> <leader>c :call TrimWhiteSpace()<CR>
nnoremap <leader>] <c-w>g<c-]> " nnoremap <leader>] <c-w>g<c-]>
" }}} " }}}
" Plugin configuration {{{ " Plugin configuration {{{
@ -66,11 +66,17 @@ nmap <silent> <Leader><Space> :SK<CR>
let g:polyglot_disabled = ['sensible', 'csv'] let g:polyglot_disabled = ['sensible', 'csv']
" }}} " }}}
""" LanguageClient {{{ " LanguageClient {{{
let g:languageClient_serverCommands = { let g:LanguageClient_serverCommands = {
\ 'rust': ['rust-analyzer'], \ 'rust': ['rust-analyzer'],
\ 'python': ['pyls'],
\ } \ }
"""}}} nnoremap <silent> <leader>] :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <leader>k :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> <leader>r :call LanguageClient#textDocument_rename()<CR>
nnoremap <silent> <leader>f :call LanguageClient#textDocument_codeAction()<CR>
nnoremap <silent> <leader>? :call LanguageClient#explainErrorAtPoint()<CR>
" }}}
" }}} " }}}

Loading…
Cancel
Save