If I press ESC to exit Visual Mode after I select some text, there's a noticeable delay before the text gets unselected and I'm returned to Normal Mode (even if I only select 1-2 characters). Can this delay be avoided?

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

This can be caused by being mapped to some additional functionality. For example, I use the tabbar plugin and it maps 0-9 to switch to the number buffer. Whenever a key is mapped to additional functionality like this, vim waits a few seconds after it is pressed to see if you're going to press any additional keys.

To see if has any additional mappings, run :map and look for <Esc> in the first column. When ran without any parameters, :map will list all the custom mappings. If you want to list only the mappings while in visual mode, run :vmap.

If does have additional mappings, I do not know of a way to remove the pause, besides removing the mappings. The pause is necessary for vim to unambiguously know what action you intend it to take.

link|improve this answer
In VT100-like terminals (including Xterm/Rxvt/PuTTY/GNOME Terminal), Esc is also the prefix for all special keys, including even the arrow keys. – grawity Feb 16 '11 at 15:41
@grawity: True, but Vim uses different timeout values for those escape sequences than it does for mappings, so the handling of those escape sequences usually does not cause the problem reported here. See :help 'timeout'. – garyjohn Feb 16 '11 at 17:22
Thanks, that's it. Now I only have to find which are those mappings that are interfering with my usage. – Andrei Feb 16 '11 at 17:53
feedback

Your Answer

 
or
required, but never shown

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