Lately, I’ve been trying to learn and use Vim keybindings whenever possible. I don’t have any hard stats to prove that my productivity has increased, but I feel like I spend less time bumbling around editors and more time putting the cursor where I want it. Vim is a great tool in my professional tool belt.
One of the first bits of advice I found after starting my Vim journey was to remap my Caps Lock key to Escape. It’s an easy change to make in most operating systems, and it’s much easier to tap Caps Lock than to reach up for the Escape key (especially on MacBooks with the Touch Bar).
I was surprised, then, when a colleague told me I was crazy for not having Caps Lock mapped to Control instead. I believe there can be a ton of value in that kind of off-hand advice, so I was curious.
I gave it a shot and used the same OS setting to remap Caps Lock to Control instead of Escape. While I definitely saw some benefits (especially with tools like t-mux and fzf, which rely heavily on the Control key), the loss of my easy-access Escape key drove me crazy in no time.
Enter Karabiner-Elements, which bills itself as “a powerful and stable keyboard customizer for macOS.” It’s available for macOS back to 10.9 Mavericks.
- Karabiner-Elements is very unfinished/unpolished though. Like, way pre-Alpha. It's great that Karabiner is being developed, but given the number of people that are surely using MS keyboards, the situation is rather untenable. The built in key re-mapping using system preferences, at least for my mechanical keyboard, simply doesn't work.
- 也许你从 Windows 电脑上迁移到 Mac 电脑上后,还不太习惯 Mac 电脑的键盘布局,或者你购置的外接键盘布局诡异。不要担心,Karabiner-Elements 可以让你在 Mac 电脑上任意定制键位,完全符合你熟悉的布局。.
Karabiner Elements Anki
I installed Karabiner-Elements and imported one of their dozens of rules: “change caps_lock to control if pressed with other keys, to escape if pressed alone.” It does exactly what it says with no fuss. Now a single tap of my Caps Lock behaves just like tapping Escape. But hitting any other key in addition to Caps Lock behaves just like hitting Control with that other key.
Karabiner Elements Mac
Karabiner-Elements enables you to remap your keyboard by applying various predefined settings, but also offers you the possibility to make your own settings, by manually editing the private.xml document. More importantly, the application also includes tools for adjusting the key repeat interval for. Karabiner is life changing tool that lets you remap keys at a low level on macOS. I completely remapped my keyboard with it and every key on my keyboard is a custom modifier key. After running sudo chflags noschg 'Karabiner-Elements.app', couldn't delete with Move to Trash, but sudo rm -rf Karabiner-Elements.app deleted the app. Same for EventViewer. The uninstall script didn't work, maybe because I'd already deleted most of the app by hand. All this in Catalina.
Karabiner Elements Download
Keybinding nirvana. Now I’ve got easy access to Escape for all of my Vim needs, but I also have easy access to any shortcuts based on Control. If you’re set up with fzf and vi mode in your command line like I am, this mapping is awesome. Easy access to Escape makes vi mode a breeze, and the fzf shortcuts are easier to reach with Caps Lock mapped to Control.
Karabiner Elements Pc
Always be on the lookout for even small bits of advice like this. It’s unlikely that any one small change will wildly affect your productivity. But by staying open to small improvements and building many of them into your setup over time, you can get closer and closer to being a keyboard wizard.