Last Updated: February 25, 2016
·
4.895K
· benjaminrh

Vim oriented keyboard setup for Mac

I've found this setup works wonderfully when using vim intensively on a Mac.

First, I swap the <kbd>ctrl</kbd> and <kbd>Caps Lock</kbd> keys on the left side of the keyboard, so I can easily reach the <kbd>ctrl</kbd> key with my left pinky. Most of my keyboard shortcuts in vim that don't involve the leader key use <kbd>ctrl</kbd>.

  1. Go to System Preferences > Keyboard > Modifier Keys
  2. Swap: Caps Lock -> Control
  3. Swap: Control -> Caps Lock

Then, I setup the <kbd>ctrl</kbd> key (formerly <kbd>Caps Lock</kbd>) to only function normally if pressed in combination with another key (enabling keyboard shortcuts). The rest of the time (i.e. if pressed by itself) it functions as another <kbd>esc</kbd> key. This means that, instead of mapping escape to ii or something, I get both keys for free in an easily accessible location.

  1. Install Karabiner
  2. Find the Change Key > Change Control_L Key (Left Control)
  3. Check the Control_L to Control_L (+ When you type Control_L only, send Escape) setting
  4. Enable it on login at System Preferences > Users & Groups > Login Items

2 Responses
Add your response

VIM ALL THE KEYS!

over 1 year ago ·

I especially like the first suggestion. I rarely ever use my Caps key anyways and I always find myself fumbling around to find the control key. Thanks :)

over 1 year ago ·