Avoid ESC in Vim

OK, this is one of those times when I’ve been humbled again.  I’ve been using Vim for over a decade now, and once in a while it occurred to me that using ESC to exit to normal mode is NOT the most efficient thing ever.  Maybe my little finger is too little, or maybe my keyboards are too large.  But reaching ESC with while in the middle of crazy typing session broke my concentration a few times.  But somehow I just thought that it is one of those most natural Vim things that I had to get used to.  Today, I came across something genius that told me that I don’t have to.  If you have the same problem, edit your .vimrc file and add the following lines:

" exit to normal mode with 'jj'
inoremap jj <ESC>

Once you load your new configuration, typing ‘jj‘ in insert mode will be equivalent to press ESC key.  Brilliant!

Leave a Comment