Open AntonC9018 opened 5 months ago
I guess that <C-c>
is defined in c
mode implicitly, which cancels the command, so the following is a workaround I just discovered
https://github.com/AntonC9018/nvim-config/blob/d00bde82a02ccf01b615c663a544dbbb8cfdf4d1/init.lua#L752-L776
This intended behavior for mapped escape in vim and no one really knows why it is the way it is. https://github.com/neovim/neovim/issues/21585
So I'm trying to configure cmp in the following way:
autocomplete = true
);C-j
andC-k
(this works correctly);Tab
(also works correctly);Esc
, if there is an item selected. Otherwise, run the defaultEsc
action (go to normal mode for insert mode, or cancel the command in prompt mode).I have been able to achieve this last point, but only for insert mode. For command mode, the fallback action confirms the command instead of cancelling it like it's supposed to work. The relevant code is here: https://github.com/AntonC9018/nvim-config/blob/d24755721dd361038c4311e42c2a9d60fdad78a0/init.lua#L660-L672 It then goes ahead and transforms those keys from
{ '<Esc>' = ... }
into{ c = { '<Esc>' = ... } }
and assigns them here: https://github.com/AntonC9018/nvim-config/blob/d24755721dd361038c4311e42c2a9d60fdad78a0/init.lua#L765This might be a bug? I'm not sure. But it's not intuitive for sure. I've spent more than a day just on this already, so I'm really desperate for some help.