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

I started remapping the Caps Lock key to the Escape command when I got my tbMBP, and now it's the very first thing I do on every single computer I start using, touch bar or not. MacOS even now offers this as a 1st party option in system preferences, it works phenomenally. I even love, at a visceral level, the balanced symmetry of ESC and ENTER being opposite each other.


You can make the Caps Lock key even more useful by turning it into a "Hyper" modifier (Command+Ctrl+Option+Shift) when it is held down (great for system-wide shortcuts in Hammerspoon[0], since application shortcuts that use all four modifiers are very rare) but acts like pressing "Escape" when it is tapped.

This is easily done with Karabiner Elements[1] and a simple rule[2] you import and enable.

[0] http://www.hammerspoon.org

[1] https://github.com/tekezo/Karabiner-Elements

[2] https://pqrs.org/osx/karabiner/complex_modifications/#caps_l...


Do you happen to know how to do that on a linux machine running X? I'm afraid to dive back into the xkb rule hell-hole to figure it out myself.


setxkbmap -option 'caps:ctrl_modifier'

handles part of it and

xcape -e 'Caps_Lock=Escape'

does the rest. xcape is in the ubuntu repos, for fedora there's a copr (dawid/xcape).


Thanks, I'll check out xcape.


you don't need xcape as others have suggested, setxkbmap -option caps:escape does it with just xkbmap.


Try xcape


If you're a Vimmer this is invaluable. ctrl-c and esc feel terrible after that.


I get bye with capslock remapped as control and using ctrl-[, which is the pinky of each hand and requires minimal movement. Control in general is useful for everything, escape not as often.


Ctrl-C is another option that works the same as Escape and is easier to activate with one hand.


Not quite. If you want to append or insert characters using blockwise visual mode in vim, it won't work with Ctrl-C. It will work with Ctrl-[ or Esc.


That's true for the default behaviour. Ctrl-C also won't call autocommands (like InsertLeave).

But - you can always map <C-c> to <ESC>, so that it'll work exactly the same.


I both knew this and read the post I was responding to, which also brings this up as an option. I commented about Ctrl-[ because it was the last previously-unmentioned option.


My bad. I didn't even catch that "ctrl-c" was mentioned in the parent!


I'm hesitant to do this for portability reasons, but it really would be a great method. Instead, I have some stuff in my .vimrc, which is a lot easier to port over than a key-remap.


I use "imap zz <ESC>" . ZZ is already save and quit so it feels quit natural.


> I started remapping the Caps Lock key to the Escape command

I could't care less about this, but...

> even love, at a visceral level, the balanced symmetry of ESC and ENTER being opposite each other.

now that you mentioned it, I absolutely HAVE to do it!


Same, but I always remap Caps Lock to Control since I use the emacs keybindings. Using other people's laptops is really disorienting now, but worth it :)




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

Search: