0

I've recently read that some people put inoremap jk <Esc> on their vimrc to exit insert mode without having to move their hands away from the home row. But then how do you type the letters jk? Is this just not possible at all if you do this?

I read on an answer to this question that vim by default waits one second to see if you're gonna press anything else, but this hasn't been the case when I try it.

2
  • 2
    I used to use this mapping; FWIW, I eventually got rid of it. It was too easy to accidentally do jk<other edits> and make a mess of the file when I was using a vim that wasn't configured in the same way.
    – D. Ben Knoble
    Jul 6 at 14:38
  • That's understandable. I don't often use computers other than my own though, so I don't think it should cause me issues.
    – Katie And
    Jul 6 at 22:30

1 Answer 1

1

Ok I figured it out. It turns out that I had misunderstood the timeout.

I had understood that if you pressed j then waited 1 second, it'd expect you to type k, and if you did, it'd take you out of insert mode.

What actually happens is the opposite, the wait is for it to stop expecting the command, not for it to begin expecting it.

I decided to reduce the timeout to only 200ms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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