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.
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.
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.
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.)
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.
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.
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.
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.
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
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.
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.
The backspace key is also a pretty inconvenient reach. I have my capslock key remapped to backspace and it's wonderful.
When was the last time you (intentionally) used your caps lock key?
No, seriously.
Here is a typical US-layout qwerty (mac) keyboard. Notice:
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 for introducing me to this idea.