vim: Add more languageclient mappings

This commit is contained in:
Simon Bruder 2020-05-31 20:22:55 +02:00
parent 404f91788c
commit deb8c82256
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -80,7 +80,17 @@ let g:LanguageClient_serverCommands = {
\ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
\ }
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
function LC_maps()
if has_key(g:LanguageClient_serverCommands, &filetype)
nnoremap <buffer> <silent> <F5> :call LanguageClient_contextMenu()<CR>
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
set formatexpr=LanguageClient#textDocument_rangeFormatting_sync()
endif
endfunction
autocmd FileType * call LC_maps()
" Multi-entry selection UI
Plug 'junegunn/fzf'