Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 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.

share|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. –  user67834 Feb 16 '11 at 17:53

What you can do still, is using CTRL+C to exit Visual mode, That should avoid the delay.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.