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

1 Answer 1


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.

  • After using this mapping, arrow keys insert capital B,D, etc in insert mode. Is it possible to not have it that way? Am using Mac OS. Thanks!
    – codepoet
    Commented Feb 12, 2021 at 19:31

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.