The first thing a newbie Emacs user learns is that it’s recommended to switch CapsLock to Ctrl. Great idea, except I was using it to switch keyboard layouts (Russian <-> English).
I explored some options:
- Switch CapsLock to Ctrl and use the default Win+Space for layouts;
- Keep CapsLock for the layout change, setup pressed Space to act as Ctrl.
There was also a question of Compose key which was mapped to AltGr. And don’t forget the need for an occasional use of the real CapsLock.
While I liked an idea of using Space and potentially getting used to keyboards which might have dedicated thumb keys for modifier, the setup was slightly more annoing and even more so if I ever need to use Windows. Thus, I settled on this:
- CapsLock to Ctrl: in GNOME Tweaks go to Keyboard -> Additional Layout Options -> Caps Lock behavior -> Make Caps Lock an additional Ctrl;
- Keep left Ctrl as is for now to get used to the new layout;
- Double Shift as CapsLock: in GNOME Tweaks go to Keyboard -> Additional Layout Options -> Compatibility options -> Both Shifts together enable Caps Lock;
- Use default layout change on Win+Space but install Quick Lang Switch GNOME extenstion to hide the annoying switcher popup;
- To be able to use Emacs layout change separately from system’s enable “Switch input sources individually for each window” in GNOME settings -> Keyboard.
- Use ScrLk as a Compose key: in GNOME Settings go to Keyboard -> Compose key. I’m using Dell XPS laptop, so for times without external keyboard: ScrLk == Fn+S.
By the way, there is a setting in GNOME Tweaks to enable Emacs input to override default shortcuts. Here is a guide on how to enable it and fix other programs. You should also be aware of potential problems with select all and copy to clipboard shortcuts. I haven’t turned on this setting yet, but it’s a nice option to have.