1

How can I get the effect of multiple <ESC>s being pressed when I press <ESC> once?

My current config requires me to press <ESC> twice to switch to Normal mode: once to close the completion pop-up and again to switch to Normal mode.

This is what I tried (and it didn't work):

:imap <ESC> <ESC><ESC>

Note: I am using NeoVim version 0.2.2

3

For future references, I would suggest you to always use noremap version of vim keymapping. Otherwise, the mappings get remapped. For example when you map like this:

:imap <Esc> <Esc><Esc>

Your mapped <Esc> gets again mapped to two more <Esc>. So it would probably be recursive. So, instead do this:

:inoremap <Esc> <Esc><Esc>

This will cancel remapping in the mapped keys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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