I'm having some trouble successfully remapping a key to <Esc>
. I have tried this with multiple characters, so let's say I want to remap 1
to <Esc>
. In my .vimrc
file, I added the following line:
noremap! 1 <Esc>
This works fine for exiting insert mode, but when I'm in command mode, the command is executed rather than escaped from. For instance, in normal mode, if I type:
/searchtext1
Rather than exiting back to normal mode without searching, the search results for 'searchtext' appear. Likewise for commands beginning with :
. Is there a workaround for this? Am I using the wrong map function?
I am using Vim from the Terminal, although after testing it on the MacVim GUI, it also has this problem.
<cr>
. – Phro