Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Consider mapping CapsLock to Esc (and Ctrl when long-pressed) with Karabiner. I haven't used my physical Esc key since 2014 or something. Might help with your issue.


You don't need a third party tool; System Preferences does this for you already. (Maybe not the long-press, but I'm vim, not emacs).


If you remap CapsLock to Esc, what key do you use for Control for doing Control A, Control E, Control K, Control Y, Control N, and Control P in every application?


I tried to address this in my parentheses, but Karabiner specifically lets you bind CapsLock to both: Esc when tapped alone, and Ctrl when held down in combination with other keys.

And your post also answers you sibling comment: Ctrl modifier is useful outside of just Emacs.

Try it out. I believe the API changed in the macOS release before Mojave, so they relaunched Karabiner under the name Karabiner Elements. This option is under the "Complex Modifications" tab.

If I was writing a list of tricks for macOS power users to try, this would be my number one. Up there with binding a global show/hide hotkey for iTerm (I use Ctrl-Space, thus CapsLock-Space).


I prefer Magic Trackpad 2 (or native MBP 2015 trackpad) to any other way of navigation but Vi keybinds -if available- work as well.

I currently use Karabiner for this as well, but a slightly different configuration.

The two rules I use are:

* R-Cmd + hjkl are arrows (which works great with HHKB but even on native MBP it requires less movement of hand from trackpad or typing hand than the arrow keys)

* Caps solo is Esc while Caps with another key equals Ctrl.

Is there a way to do this in Linux as well? I currently have to use Linux regularly and I rebind Caps to Ctrl however for Vim it isn't ideal. So I'd like to have the same functionality I have with Karabiner on Linux (Xorg / console).


You can use xcape on linux to do this. I use it to map CAPS to CTRL/ESCAPE, and right shift to RIGHT SHIFT/COMPOSE


I use Karabiner Elements to bind backtick (grave accent) to Esc, Command-backtick to Command-backtick as normal (so you can switch between windows of the same app), and Option-backtick to backtick.

It's not optimal, but I do it because backtick is about the same position as a hardware Escape key. It makes using vim feel ok again.

This option is available from the KE Complex Modifications tab.


Note that this means you lose the ability to use option-backtick for diacritic marks. Normally option-backtick followed by a makes "à", Option-backtick followed by e makes "è", etc


This isn't working for me in Mojave; you haven't had a problem?


In this mode... if you hold down CapsLock as Ctrl and then don't decide to press another modifier... does it still fire CapsLock as Esc?


I already have a ctrl key, though. Whatever works for you, though--personally, I prefer not installing extra third-party systems-level software over making ctrl marginally more convenient to press.


Are you denoting control+shift+a as control-A?


No, I was just typing on a phone. I meant control+a (start of line), control+e (end of line), etc.


Capslock is ctrl for most developers I know (because it's by far the most used key in terminal/Vim/emacs/etc).


Yes. Although in a Kinesis Advantage keyboard (the "official" Emacs keyboard), because the Control is under the thumb, it is useful to remap the CapsLock to Esc.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: