Using en-dash and em-dash in SwayWM with Compose
Published on:
While many think that people who use en-dash or em-dash are using LLMs, it’s pretty easy to do with a keyboard, and I use it quite a lot in my blogs.
Most keyboards available now has a compose key, and even if it doesn’t, the operating system can usually handle it by mapping the compose key to another less-used key.
In my SwayWM configuration, I have the following:
input type:keyboard {
xkb_options "ctrl:nocaps, compose:ralt"
}
The first option makes the caps lock key behave as Ctrl key. The second option makes the right Alt key behave as the compose key.
To type an en-dash (–), I have to press and release the right Alt key, then type --. (two dashes followed by a period/full stop/dot).
To type an em-dash (—), I have to press and release the right Alt key, then type --- (three dashes).
I’ve been using it for too long that I instinctively try to type it that way on all other systems and be disappointed. Just lookup how to do it in your system, it can usually be done without any configuration or installing anything new!