`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.)

@mikegerwitz I used to use -caps:none, but now I’ve got caps as my Compose Key and I’m not going back. Ĥéłłö diacritics!

(Though in practice setxkbmap stopped working properly for me a while back, and instead I set up compose key via the keyboard settings on Cinnamon).

@pganssle That's actually something I have to play around with more; I'm so used to living within Emacs, where such composition can be done any number of ways (including the wonderful LaTeX input mode).

But I'm lost in any other situation, like my web browser, and end up having to compose in Emacs or Vim and copy it in.

@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.

@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
Mike Gerwitz's Mastodon Instance

Mike Gerwitz's personal Mastodon instance