Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

I have no mapping bound to <ESC> globally or for Visual mode (calling :verbose vmap <ESC> gives no results) but there is still a significant delay when exiting Visual mode. Even on fresh installs with no vimrc the delay is present. Using <C-c> does exit visual mode without delay.

Since I don't like pressing <C-c> to exit any mode, I currently map <ESC> to <C-c> in visual mode. This exits visual mode using <ESC> without any delay.

:vmap <ESC> <C-c>

Or put the following line in your vimrc

vnoremap <ESC> <C-c>

This will not work if you do have global or visual mode mappings bound to <ESC>.

share|improve this answer

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

share|improve this answer

Your Answer


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