nvim/plug/coc: use <C-Space> instead of <CR> for pum inserts

Unfortunately pear-tree seems to conflict with coc in utilizing <CR>
(enter). Also the previous function assigned to <C-Space> wasn't very
useful (triggering autocompletion menu) as <TAB> already handles that.
This commit is contained in:
Paul Stemmet 2022-08-30 13:37:01 +00:00
parent 632e40a40d
commit 1222c115c9
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 1 additions and 5 deletions

View File

@ -44,11 +44,7 @@ return function()
-- Make <CR> to accept selected completion item or notify coc.nvim to format
-- <C-g>u breaks current undo, please make your own choice.
vimp.inoremap({'silent', 'expr'}, '<CR>', [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<C-r>=coc#on_enter()\<CR>"]])
-- Use <c-space> to confirm completion
-- <c-space> could be remapped by other vim plugin, try `:verbose imap <CR>`.
vimp.inoremap({'silent', 'expr'}, '<C-Space>', [[coc#refresh()]])
vimp.inoremap({'silent', 'expr'}, '<C-Space>', [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<C-r>=coc#on_enter()\<CR>"]])
-- Use `[g` and `]g` to navigate diagnostics
vimp.nmap({'silent'}, '[g', '<Plug>(coc-diagnostic-prev)')