Remap your caps lock key

post by bilalchughtai (beelal) · 2024-12-15T14:03:33.623Z · LW · GW · 15 comments

Contents

15 comments

When was the last time you (intentionally) used your caps lock key?

No, seriously. 

 

Here is a typical US-layout qwerty (mac) keyboard. Notice:

  1. Caps lock is conveniently located only one key away from A, which is where your left pinky should rest on the home row by default.
  2. Caps lock is absolutely massive.
  3. How far various other keys you might want use often are from the home row.

 

Remap your caps lock key.

I have mine mapped to escape

Modifier keys such as control or command are also good options (you could then map control/command to escape).

 

How do I do this you ask? 

 

Thanks to Rudolf [LW · GW] for introducing me to this idea.

15 comments

Comments sorted by top scores.

comment by Dagon · 2024-12-15T15:53:54.616Z · LW(p) · GW(p)

Go further with this.  Don't map it to a single key, use it as a modifier so other keys have more functionality.  using CL+hjkl as arrow keys is great for VI users, CL+WASD for gamers - either way you don't need to move your fingers as much.

I use and recommend https://ultimatehackingkeyboard.com/, which defaults to putting the mod key in place of caps lock (it's fully programmable, so you can do what you like.  On Windows, https://www.autohotkey.com/ is extremely flexible.

comment by Adam Zerner (adamzerner) · 2024-12-15T19:49:36.199Z · LW(p) · GW(p)

When I was a student at Fullstack Academy, a coding bootcamp, they had us all do this (mapping it to the control key), along with a few other changes to such settings like making the key repeat rate faster. I think I got this script from them.

comment by lsusr · 2024-12-16T03:28:08.940Z · LW(p) · GW(p)

If you use Linux, I trust you can manage on your own.

Personally, I put the line exec --no-startup-id setxkbmap -option ctrl:swapcaps in my .config/i3/config file. Of course, this only works if you're using the i3 tiling window manager. And if you unplug your keyboard you'll have to re-run the command manually.

Replies from: MichaelDickens
comment by MichaelDickens · 2024-12-17T05:36:28.018Z · LW(p) · GW(p)

On Linux Mint with Cinnamon, you can do this in system settings by going to Keyboard -> Layouts -> Options -> Caps Lock behavior. (You can also put that line in a shell script and set the script to run at startup.)

comment by Yair Halberstadt (yair-halberstadt) · 2024-12-16T16:48:41.484Z · LW(p) · GW(p)

Chromebooks replace the caps lock key with a search key - which is functionally equivalent to the windows keys on windows. E.g. search+right goes to the end of the line.

comment by Neel Nanda (neel-nanda-1) · 2024-12-16T06:00:27.740Z · LW(p) · GW(p)

When do you use escape?

Replies from: maybecorrect
comment by core_admiral (maybecorrect) · 2024-12-16T16:01:18.286Z · LW(p) · GW(p)

The escape remap is popular among users of vim or the vim keybindings in other editors since it's used there a lot. OP might have a different use, just noting it here for any vim user or prospective user who hasn't done it yet. 

comment by Yiar · 2024-12-15T22:53:18.102Z · LW(p) · GW(p)

I use ProtoTyping: https://github.com/pnutus/ProtoTyping

How it works:

Capslock as modifier, hold it to use right hand for:

ijkl like wasd where:

i : to move cursor one row up

k : one row down

j : one character left

l : one character right

————————

u : one word left,

o : one word right,

h : to go to beginning on line,

key right of L : to go to end of line.

————————

Then also use modifier with left hand at the same time as Capslock to:

s : selecting text with movement commands described above. E.g. Capslock + s + o, to select the next word.

d : deleting text with movement commands described above

————————

Examples:

E.g. Caps + d + h to delete everything to the left of the cursor on the line. If you need to delete multiple lines just: (Caps + d + i)x3, e.g. to delete three rows. (very useful in programming)

E.g. (Caps + s + u)x3, to select the 3 words to the left of the cursor, so you can then copy them e.g.

This helps you not have to move your hand to the mouse or to the arrow keys as much. Your hands stays in the right position for touch typing (fast typing) where index fingers rest on f and j. Just release caps for a bit to write, and quickly move around holding down caps.

You can use it in any app, not just code editors.

comment by Seth Herd · 2024-12-15T18:57:29.153Z · LW(p) · GW(p)

Absolutely.

My caps lock has long been Control. I use ErgoEmacs for easy use of editing commands like delete/select word forward, delete/select word back, up line, up par, etc.

These are laid out systematically in ErgoEmacs, so are easy to learn and remember.

Only tangentially related:

for more fun and speed, learn to use the trackpad with your thumb(s) while your fingers stay in home position.

Use a wrist rest so your arms aren't tensed holding your hands in place.

All of these are independent. For the love of Pete remap your caps lock key to a modifier if you haven't. MacOS encourages this by putting it in system settings.

comment by Vale · 2024-12-15T14:17:25.592Z · LW(p) · GW(p)

Personally, I've had my Caps Lock key bound to Escape for quite a while (I'd suggest a few years now?). It has been lovely and fits perfectly with my keyboard-driven workflow. Pairs great with Colemak-DH, which is my layout of choice.

I haven't found myself ever missing the Caps Lock key's original functionality, and my blank laptop keycaps mean I can have it bound without mental annoyance.

comment by MichaelDickens · 2024-12-17T05:32:46.521Z · LW(p) · GW(p)

I use a Kinesis Advantage keyboard with the keys rebound to look like this (apologies for my poor graphic design skills):

https://i.imgur.com/Mv9FI7a.png

  • Caps Lock is rebound to Backspace and Backspace is rebound to Shift.
  • Right Shift is rebound to Ctrl + Alt + Super, which I use as a command prefix for window manager commands.
  • "custom macro" uses the keyboard's built-in macro feature to send a sequence of four keypresses (Alt-G Ctrl-`), which I use as a prefix for some Emacs commands.
  • By default, the keyboard has two backslash (\) keys. I use the OS keyboard software to rebind the second one to "–" (unshifted) and "—" (shifted), which for me are the most useful characters that aren't on a standard US keyboard.
comment by Aransentin · 2024-12-16T08:47:02.535Z · LW(p) · GW(p)

I worry that if I remap it to something actually useful I will commit it to muscle memory and begin to inadvertently press it when using a computer that's not my own. Depending on how often you switch computers this could be worse than the status quo.

Replies from: MichaelDickens
comment by MichaelDickens · 2024-12-17T05:38:41.278Z · LW(p) · GW(p)

I primarily use a weird ergonomic keyboard (the Kinesis Advantage 2) with custom key bindings. But my laptop keyboard has normal key bindings, so my "normal keyboard" muscle memory still works.

comment by Defective Altruism (Elijah Bodden) · 2024-12-15T22:03:51.676Z · LW(p) · GW(p)

The backspace key is also a pretty inconvenient reach. I have my capslock key remapped to backspace and it's wonderful.