`setxkbmap` can be used to modify the keyboard layout under X11. For example, I use `setxkbmap -option ctrl:nocaps` to bind capslock to ctrl, to cut my pinky and wrist some slack.

Some people bind capslock to escape (e.g. `-option caps:escape`) because that's the keyboard layout under which vi was developed. I don't bother, because ^[ is equivalent to escape in a terminal, so I get more utility out of having ctrl:nocaps.

(See `man xkeyboard-config` if your system has it.)

#thanksfreesw

@mikegerwitz This seems like the best advice I heard in a while. I changed in the KDE keyboard settings. Tried both caps as esc and as ctrl. The latter has much better returns, also outside Vim. For example:

- Ctrl+Enter, Ctrl+Backspace: Here in mastodon's compose box, and most messaging applications
- Ctrl+C, Ctrl+V
- Ctrl+T, Ctrl+W: For firefox tabs
- etc, etc.
Have to get used to it though.

Follow

@ashwinvis @mikegerwitz there's also the wonderful xcape tool which let's you assign different actions to a key when being pressed alone or together with another.

In other words, with the remapping and xcape you can use capslock as both ctrl and esc - best of both worlds.

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.