Compose Key on macOS
I frequently switch between Windows, Linux, and macOS laptops and the thing that annoys me by far the most are the different keyboard layouts. I have remapped my Windows/Linux keyboards from Ctrl, Super, Alt to Super, Alt, Ctrl. This is more in line with what macOS has and moves the Ctrl-key—which I use most frequently out of the three—from under my pinky to under my thumb. It also minimizes the muscle memory issues when switching platforms between common operations like cut, copy, paste, select all etc. so far, so good.
I prefer typing on an ANSI layout (over ISO) and a Dvorak key map. Since my native language is German, however, I frequently need to type letters like
ß. On Linux, there is the Compose Key to easily type any sort of alternate characters. Although this functionality doesn’t ship with Windows, there is this fantastic piece of open-source software: WinCompose. I set the modifier to the Right Alt and I can type precomposed characters on Windows just as I would on Linux.
Unfortunately, no such thing exists on macOS. It comes with its own set of dead keys. The key press to print the diaeresis/trema
¨ is Left Opt+u, the next key press then adds the composite character, e.g., Left Opt+u,a prints
ä. With the Compose Key, this is Compose,Shift+",a. In my opinion, many of the Compose Key combinations are more intuitive to type, e.g., =+C prints the
€ sign (compared to Left Alt+Shift+2 on macOS). Another neat thing about the Compose key is that the order of the characters does not matter usually: ',e or e,' both print
Obviously, I’m not the first person to notice the lack of a compose key on macOS. There are projects like this and this, but neither got me to my goal of a seamless Compose Key on macOS. This blog post from 2012 finally got me there. It requires Karabiner Elements, a complex karabiner rule and a custom
DefaultKeyBinding.dict—I have copied the file to a gist, head over to the original post to download it from there. The post and the comments are definitely worth a read, even if they are a few years old.
There are still many keymap-muscle-memory-issues left, like jumping to the beginning and end of words and lines, but this solves one of my frequent problems when switching OSes.