From 05996fcdb1ffbe61d962f20221b9d540c5592e4a Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 7 Dec 2020 11:25:05 -0300 Subject: [PATCH] Added a few shortcuts for LanguageClient +] => Jump to definition +k => Show function documentation +r => Rename function/symbol +f => Fix suggestion +? => Show error explanation --- nvim/init.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index f0b2d6f..59e8c54 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -45,7 +45,7 @@ let g:rainbow_active = 1 " This is part of the Rainbow brackets, enabling it " Mappings {{{ nnoremap - :Ex nnoremap c :call TrimWhiteSpace() -nnoremap ] g +" nnoremap ] g " }}} " Plugin configuration {{{ @@ -66,11 +66,17 @@ nmap :SK let g:polyglot_disabled = ['sensible', 'csv'] " }}} -""" LanguageClient {{{ -let g:languageClient_serverCommands = { +" LanguageClient {{{ +let g:LanguageClient_serverCommands = { \ 'rust': ['rust-analyzer'], + \ 'python': ['pyls'], \ } -"""}}} +nnoremap ] :call LanguageClient#textDocument_definition() +nnoremap k :call LanguageClient#textDocument_hover() +nnoremap r :call LanguageClient#textDocument_rename() +nnoremap f :call LanguageClient#textDocument_codeAction() +nnoremap ? :call LanguageClient#explainErrorAtPoint() +" }}} " }}}