Document a function to conditionally map LC funcs
@@ -35,6 +35,19 @@ like to map these functions to shortcuts, for example: >
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
+You can apply these mappings only for buffers with supported filetypes with a
+simple function: >
+
+ function LC_maps()
+ if has_key(g:LanguageClient_serverCommands, &filetype)
+ 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>
+ endif
+ endfunction
+
+ autocmd FileType * call LC_maps()
+
If one is using deoplete/nvim-completion-manager at the same time, completion
should work out of the box. Otherwise, completion is available with 'C-X C-O'
('omnifunc').
