Vim – unmap Esc!!

So I had the bright idea (by no means original, though, as I later figured out) that it’d be great to avoid the Esc key on Vim as its so far away from the home row. The alternative to pressing Esc is Ctrl-[ which, even though I’ve mapped CapsLock to control, I still find hard. So then, after some more googling around I’ve settled down on mapping jk to Esc. Its been a few hours with this setup and while its been an absolute pain till now, I think its a great way to avoid the Esc key jump. I can already feel my finger muscle memory relearning and my hand jumps instinctively for the Esc key much less now.

Here’s my setup in case you want to try this out. Bung the following into your .vimrc or _vimrc as the case may be:

    inoremap  :echoe "use jk"
    inoremap jk 

The first mapping makes VIM echo a reminder. Its not friendly since it introduces a pause. However, the idea is to make the Esc so painful that you will shy away from hitting it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s