Aug 27, '17

Hjkl everywhere, would Yoda do.

One of the biggest draws to Vim is the ability to keep one's hands near the home row. Unfortunately, one of the most common keys in Vim is the dreadfully far ESC key. And so, most Vim users end up remapping said ESC key as their first mission. Some common mappings include jj and jk, because these letter combinations don't ever really occur within words in the English language. Another common mapping is CAPS, though it requires extra work at the OS level due to the nature of it being a modifier key.

Once ESC is mapped, the next big hurdles are learning the basic modes (insert mode, normal mode, command mode, etc.) as well as hjkl for cursor movement. The latter was huge for me, as I found myself reaching for the mouse less, and as a result making less mistakes from rushing back to the home row.

If these were the only Vim features I ever learned, I'd still be happy as a lark. However, all this happiness disappears when leaving the editor. Suddenly, hjkl doesn't help me navigate through dropdowns and text fields 😱

Do. Or do not. There is no try.

So I wrote this complex modification for Karabiner Elements, so that one can hjkl while holding CAPS, anywhere in MacOS (or in Windows using this AutoHotkey script). Furthermore, tapping CAPS posts an ESC. Go forth and Vim all the things!