0

I am using NVIM 0.9.0 stable release with Conqueror of Completion which I installed recently.

I am used to using the arrow keys in insert mode for quick navigation between two lines. After installing coc, whenever I press the down or up arrow keys, I get

coc#pum#visible() ? coc#pum#next(0) : "\"

and

"
coc#pum#visible() ? coc#pum#prev(0) : "\

repectively. I have not set any special Key Bindings related to coc except:

nnoremap <C-l> :call CocActionAsync('jumpDefinition')<CR>

:verbose map <Up> does not return anything, However this is the output of :verbose map! <Up>:

i  <Up>        *@pumvisible() ? '<Up>' : '<C-R>=<SNR>42_FlushBuffer()<CR>coc#pum#visible() ? coc#pum#prev(0) : "\<Up>"'
        Last set from ~/.local/share/nvim/plugged/vim-autoclose/plugin/AutoClose.vim line 471
i  <Up>        * coc#pum#visible() ? coc#pum#prev(0) : "\<Up>"
        Last set from ~/.local/share/nvim/plugged/coc.nvim/plugin/coc.vim line 733
5
  • Maybe could you share with us the mapping you define for <Down> and <Up> in insert mode? It will help to reproduce and analyse your problem. Apr 9, 2023 at 16:50
  • 1
    @VivianDeSmedt I only have the default mapping for up and down arrow keys. Plus, I don't have a lot of mappings in my init.vim, only one related to coc, the others are for nerd tree Apr 10, 2023 at 10:52
  • @D.BenKnoble Edited question Apr 11, 2023 at 11:31
  • Looking at the code of vim-autoclose it seems that something odd is done. One way would be to replace vim-autoclose by a maintained plugin (e.g. :CocInstall coc-pairs) another would be to fix AutoClose.vim at line 472 :-/ Apr 11, 2023 at 11:50
  • Do you still have something open in the question? How can we help you? Apr 15, 2023 at 3:37

1 Answer 1

1

I believe vim-autoclose is not compatible with the coc pre-mapping of Up. vim-autoclose assumes that the pre-mapping of Up is either nothing or a fixed string. But the coc has an expression mapping for Up and this is not expected by vim-autoclose.

I suggest you to replace the unmaintained vim-autoclose by a maintained solution for auto pairs (since you are already using coc maybe could you use: :CocInstall coc-pairs)

Other maitained contender are:

Remark: Another solution is to correct the way auto-close reuse the mapping of coc-nvim. The s:CreateExtraMaps() of auto-close need to be adapted but, the plugin not-being maintained, this is not very motivating :-|.

Remark: Another attempt you could do is the change the order in which coc and vim-autoclose are declared. Since the problem come from the way vim-autoclose correct the mapping if coc is declared after vim-autoclose it could be that it solves the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.