From 95bd07aa10dbcacbdce1669c30b6e2073fdf3764 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 17 Dec 2020 15:49:59 +0100 Subject: [PATCH] vim: More usage LanguageClient --- .vimrc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index aebc799..7f2b573 100644 --- a/.vimrc +++ b/.vimrc @@ -350,6 +350,8 @@ function Help() try if exists('b:current_syntax') && b:current_syntax == "python" :call ShowPyDoc(expand(""), 1) + elseif has_key(g:LanguageClient_serverCommands, &filetype) + :call LanguageClient#textDocument_hover() else execute "Man " . expand("") endif @@ -591,7 +593,23 @@ nnoremap O :FZF! if v:version >= 800 " Async lint - Plugin 'w0rp/ale' + "Plugin 'w0rp/ale' + Plugin 'autozimu/LanguageClient-neovim', { + \ 'oninstall': 'bash install.sh', + \ } + let g:LanguageClient_serverCommands = { + \ 'cpp': ['clangd', '-background-index',], + \ 'c': ['clangd', '-background-index',], + \ } + + function LC_maps() + if has_key(g:LanguageClient_serverCommands, &filetype) + nmap K (lcn-hover) + nmap gd (lcn-definition) + nmap cr (lcn-rename) + endif + endfunction + autocmd FileType * call LC_maps() else "Syntax checking | Install flake8 or pylint for python " Install shellcheck for bash