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

Remap capslock to CTRL when held and ESC when tapped. Good idea for vim too


Looks interesting. I've always remapped capslock to CTRL myself, of course, but haven't thought of remapping tap-capslock to ESC. It looks like you need external software to do this though (like Karabiner Elements on mac, or xcape on linux, etc).

(That being said, if you're used to jk/kj/fd/jj/jf, many years of muscle memory would still take a while to erase...)


For Ubuntu/LinuxMint :

Ubunutu --> Gnome Tweaks --> Additional Layout options --> Make Caps Lock an additional ESC

Linux Mint --> Keyboard --> Layout --> Options --> Same

From the terminal : setxkbmap -option caps:escape

There are option to swap CapsLock and Escape too, or you can have CapsLock when pressing both shift keys and other worthwhile options


Actually, MacOS can do this out of the box with no extra software installed. It's in the keyboard settings


You can only map CapsLock to a single modifier in keyboard settings? Which is how I've always had it myself (caps->ctrl) but that's not what's being discussed here.


What is? Tap to that, hold to this?

In Mac? Never.

Shame tho...


Do it now and your only regret will be not doing it sooner :)


Using caps lock to escape is close to the ergonomics of an early terminal used by Bill Joy where the escape key sat to the left of Q.

https://twobithistory.org/2018/08/05/where-vim-came-from.htm...


The classic mapping is Alt/Meta to send escape when tapped, because terminals send Alt-q as `ESC q`.

I have no strong opinions about how people lay out their keyboards, other than that people should try a split key if they haven't. My layout sends ESC when Alt is tapped, capslock is for backspace.


What about holding spacebar to overheat the computer and exit emacs?


What about it?



I know the xkcd, I just don't understand your point.


I was just making a joke about how deep we can all get into configuring every little thing on a PC - no offense or point intended, I spend as much time configuring my boxes as using them if I'm being honest.


CTRL+[ also sends ESC control code.

So you don't even need to map ESC on tap (I prefer to map layout switching to it).


It's a matter of habit, I guess, but.

- Ctrl-[ is a chord that you have to press with 4/5 fingers using both hands at once.

- Whereas jk/fd etc are next to each other on the home row and pressed with 2/3 of the same hand sequentially.

Given the number of times you would have to exit insert mode, the second option is arguably more ergonomic...


The one cool thing about CTRL+[ - it is universal in terminal and doesn't depend on configuration.


I tried that for a while, but having ESC on release instead of on press just didn't feel right for me




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

Search: