I've recently mapped jj to <ESC> in insert mode for quick escaping. While everything is functional, I find the brief delay after typing j while it waits for a second input very distracting.

Is it possible for a j to always be instantly inserted into the buffer, then if I press j again the first one is removed before returning to normal mode?

Do I need to use some sort of script for this? I've tried fiddling with the timeoutlength and ttimeoutlength options but they don't seem to do what I want.

  • 1
    While I understand you point, I couldn't reproduce it. Can you try with vim -Nu NONE ?
    – nobe4
    Commented Aug 23, 2016 at 8:58
  • 1
    @nobe4 I feel stupid now, assumed this was the default behaviour with vim but it's actually a problem with the vim emulator in my IDE. Don't think it's fixable, but thanks for clearing it up! Commented Aug 23, 2016 at 9:24
  • 1
    When in doubt, always try from scratch vim :)
    – nobe4
    Commented Aug 23, 2016 at 9:28

1 Answer 1


Add <nowait> to map command, which will prevent this delay. It will instantly leave insert mode as soon as the second j is pressed, as well as remove initially typed j. Also if you need to type literal "jj", you'd need to wait a bit, but it's very rare. Also you won't be able to map something like jjj as it won't wait for any character after jj (which is probably ok for most). See :help map-nowait for more information.

inoremap <nowait> jj <ESC>
  • <nowait> was added in Vim version 7.3.1261
  • I think it is not what the OP want. He wants no delay after pressing first j. But I think it is inevitable unless you reduce timeoutlen to very small values.
    – jdhao
    Commented Jul 30, 2019 at 9:05
  • There's no perceived delay after pressing the first j as j is inserted immediately, and one can continue typing without waiting as there's no pause or anything. There's a visual cue, ie "j" appears on bottom right briefly
    – otter.pro
    Commented Jul 30, 2019 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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