Remapping Caps Lock
osx vim

WHO USES THE CAPS LOCK KEY? The answer is no one. Do yourself a favor and either:

  1. Disable it.
  2. Remap it to something useful.

In OS X Lion, you can disable the caps lock key in:

System Preferences > Keyboard > Modifier Keys

Disabling the caps lock key seems wasteful, so a better option is to remap it. For basic caps lock remapping, you can use the Modifier Keys option in System Preferences > Keyboard. If you need more complexes mapping options, check out PCKeyboardHack.

A popular caps lock remap for vi users is escape. Many people find it awkward to constantly reach for the upper left corner of the keyboard for the escape key. My hands are large enough to efficiently reach escape while typing on the home row, so I don’t like using the caps lock for escape. I find the best use for the caps lock key is a remap to control. The control key is very awkward to use in Vim. Entering visual block mode ctrl+v or ctrl+r for redo is difficult to type rapidly and remapping caps lock to control is really useful and requires no third-party solution.