I love Vim, I've tried a bunch of different editors, counting everything from TextMate to Emacs, but I always ended up with Vim anyway.
A few days ago I noticed something in Vim that was quite abnormal. The ESC key in combination with a command such as O or I, trigger a slight delay just before it actually execute the given command.
In lack of time, I postponed the problem, and briefly switched to MacVim, in order to get my job done. I said to myself that I was going to tackle this problem when I got home.
Home
I've been doing some research and come to a valid conclusion. The problem lies within the esckeys setting in Vim.
I quote from the help section:
Function keys that start with an Esc are recognized in Insert mode. When this option is off, the cursor and function keys cannot be used in Insert mode if they start with an Esc.
The advantage of this is that the single Esc is recognized immediately, instead of after one second. Instead of resetting this option, you might want to try changing the values for timeoutlen and ttimeoutlen.
See :help esckeys for more information.
I found a Stack Overflow question that convered the issue, as well as a Vim wikia-article regarding ESC key alternatives.
The Vim documentation and some answers over at Stack Overflow seem to push for changing the timeoutlen and ttimeoutlen settings, but for me, turning the esckeys setting off was an ideal solution.
:set noesckeys
Note: Turning the esckeys setting off, disable the cursor and function keys within Insert mode. If cursor and function keys are important to you, change the timeout settings instead.
:set timeout timeoutlen=1000 ttimeoutlen=100