diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 0e8b0e1..8259952 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -80,7 +80,17 @@ let g:LanguageClient_serverCommands = { \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'], \ } -nnoremap :call LanguageClient_contextMenu() +function LC_maps() + if has_key(g:LanguageClient_serverCommands, &filetype) + nnoremap :call LanguageClient_contextMenu() + nnoremap K :call LanguageClient#textDocument_hover() + nnoremap gd :call LanguageClient#textDocument_definition() + nnoremap :call LanguageClient#textDocument_rename() + set formatexpr=LanguageClient#textDocument_rangeFormatting_sync() + endif +endfunction + +autocmd FileType * call LC_maps() " Multi-entry selection UI Plug 'junegunn/fzf'