File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,19 @@ like to map these functions to shortcuts, for example: >
3535 nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
3636 nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
3737
38+ You can apply these mappings only for buffers with supported filetypes with a
39+ simple function: >
40+
41+ function LC_maps()
42+ if has_key(g:LanguageClient_serverCommands, &filetype)
43+ nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<cr>
44+ nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
45+ nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
46+ endif
47+ endfunction
48+
49+ autocmd FileType * call LC_maps()
50+
3851 If one is using deoplete/nvim-completion-manager at the same time, completion
3952should work out of the box. Otherwise, completion is available with 'C-X C-O'
4053('omnifunc' ).
You can’t perform that action at this time.
0 commit comments