Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:37:05+00:00 2026-06-14T14:37:05+00:00

When I leave insert mode by pressing Esc , there is a half-second pause

  • 0

When I leave insert mode by pressing Esc, there is a half-second pause before Vim actually returns to normal mode.

Normally this wouldn’t be an issue, since pressing a normal mode command like j after pressing Esc executes the normal-mode command immediately (without the above-mentioned wait), but I have the mapping inoremap <Esc> <Esc>:w<CR>, so that every time I leave insert mode the file is written. I would like the write to occur immediately when I press Esc, but instead there is that half-second pause.

I’m assuming that the pause is because Vim is waiting for more input before it decides that I just meant to type a single, simple Esc. This must be because there is a mapping somewhere who’s first character is <Esc>, but I’ve looked in my .vimrc and there is no such mapping.

Furthermore, I even ran :map <Esc>, and it returned No such mapping. So, if there is no such mapping, why does Vim appear to be waiting for more input, and how can I avoid that behavior?


Extra Information

It appears that this is not reproduceable, so here is some more information in case anyone really wants to get to the bottom of this:

I am using Steve Francia’s spf13 distribution of Vim, with my own .vimrc.local on top of it. I have also installed several additional plugins using Vundle.

Notes: .vimrc.local is sourced last in .vimrc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:37:07+00:00Added an answer on June 14, 2026 at 2:37 pm

    UPDATE (3/19/2014)

    I found a far better solution than trying to hunt down all the mappings that start with <Esc>, courtesy of Powerline, from the Tips & Tricks section of the docs. Put this somewhere in your .vimrc:

     " leave insert mode quickly
      if ! has('gui_running')
        set ttimeoutlen=10
        augroup FastEscape
          autocmd!
          au InsertEnter * set timeoutlen=0
          au InsertLeave * set timeoutlen=1000
        augroup END
      endif
    

    Note that this will make it impossible to use mappings that start with <Esc> while in insert mode, but there shouldn’t be any of those anyway, because of the problem this solves.


    I found the lines in spf13’s .vimrc that were causing the problem:

    " Fix home and end keybindings for screen, particularly on mac
    " - for some reason this fixes the arrow keys too. huh.
    map ^[F $
    imap ^[F $
    map ^[H g0
    imap ^[H g0
    

    The reason I couldn’t find them before is because they weren’t mapped using <Esc>, but ^[ instead. Very irritating! Hope this helps some equally disgruntled spf13 user 🙂

    UPDATE:

    If removing those mappings doesn’t work, then it’s probably a mapping from a plugin.

    Type :verbose map <Esc> to get a list of all mappings involving Esc. The verbose part instructs Vim to print where the mapping was set. That should help find out what’s causing the problem.

    Also, the command unmap <Esc> might be useful—it removes any mappings for the Esc key.

    Note that unmap does not remove mappings in all modes; type :h unmap for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are several commands that do something and then enter insert mode. Are there
I know that I can use either: Home in insert mode Esc + i
I use an autocommand to close the preview window when I leave insert mode
The usual behavior in vim is for C-o in insert-mode to allow the user
In Vim, when I hit the backspace key in the insert mode, it leaves
In a leave application form, there are two time fields 'From' and 'To'. When
Would this be better as a stored procedure or leave it as is? INSERT
In many situations, JavaScript parsers will insert semicolons for you if you leave them
I have a SQL Insert Into command that works in normal conditions. That means
I can insert text before and after the selection using: Selection.InsertBefore start Selection.InsertAfter end

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.