The One Change I Always Make to ~/.vimrc

Written by Michael Gold on November 26, 2018

One of the nicest things about using vim as a text editor is that the key bindings allow you to control the entire program with very few movements away from the home row of keys.

The main exception to this rule is that in order to exit out of text insertion mode, you need to press the escape key.

This is a key that Apple has eliminated on nearly all of it’s keyboards.

 

Even on my hp laptop, the escape key is super small and kind of a pain to reach with my left pinky.

 

However, by inserting the line below into my ~/.vimrc file, I can remap the escape key to the sequence fd.

 

imap fd <esc>

 

Now, when I’m in vim insert mode, quickly pressing the f key and the d key will trigger an escape and exit the insert mode.

0 thoughts on “The One Change I Always Make to ~/.vimrc”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.