16 March 2009

ESC key alternative in vim

I've been using vim for a couple of years now, and I really like it. But one thing that's always been a nuisance to me is reaching for the escape key. I often hit the wrong key (like the tilde or F1), and/or I have to glance at the keyboard to find it.

A recent post by Matthew Weier O'Phinney suggested binding the 'jj' sequence to <ESC>. I've been trying that for the last day or so, and I'm finding that to be a pretty good trick. Here's what I added to ~/.vimrc to make it work:

:map! jj <ESC>

1 comment:

Andi said...

I know this post is quite old, but I just wanted to leave a message to thank you for the post. Nice idea, I just edited my .vimrc ;-).