From e324de87dad9773f02d4da0aea64d1c394c2226f Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 6 Mar 2019 15:35:07 +0100 Subject: Improve omnicompletion bindings --- pkgs/custom-neovim/asset/rc.vim | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/custom-neovim/asset/rc.vim b/pkgs/custom-neovim/asset/rc.vim index 202b1ad..31eb27a 100644 --- a/pkgs/custom-neovim/asset/rc.vim +++ b/pkgs/custom-neovim/asset/rc.vim @@ -145,10 +145,23 @@ if executable('cquery') nnoremap gt :LspTypeDefinition nnoremap gi :LspImplementation nnoremap gr :LspReferences - - nmap :LspWorkspaceSymbol - nmap :LspDocumentSymbol + nnoremap :LspWorkspaceSymbol + nnoremap :LspDocumentSymbol autocmd FileType cpp setlocal omnifunc=lsp#complete + set completeopt=longest,menuone,preview + " use enter to select completion item + inoremap pumvisible() ? "\" : "\u\" + " improve popup and selection behavior + inoremap pumvisible() ? '' : + \ '=pumvisible() ? "\Down>" : ""' + inoremap pumvisible() ? '' : + \ '=pumvisible() ? "\Down>" : ""' + " trigger omnicompletion using (compared to for plain completion) inoremap + + " close documentation buffer after selecting a completion item + autocmd CompleteDone * silent! pclose + " close quickfix buffer after selection + autocmd FileType qf nnoremap :cclose endif -- cgit v1.2.3