Keyboard Layout

Being a special snowflake, I use a custom keyboard layout.

It looks like this:

fn main() {

It is based on Colemak, but modified to give me easy access to the Norwegian letters æøå, and to put common punctuation and programming symbols on the three base rows accessed through AltGr. I avoid using the number line for anything but actual numbers and some rare symbols.

I am pretty hungry for mod-keys in general. Ctrl, Alt, Shift tend to be for the application space. The left Win key I use for my window manager (XMonad or i3), AltGr for common punctuation, and the last one (Menu key or right Win key) for rarer symbols and unicode.

I favor combining characters over precomposed characters (except for the three Norwegian characters) as I feel it’s a more elegant solution when only occasionally needing access to foreign diacretics, tho acknowlege that a lot of software has problems with combining characters.

Choice of Colemak

When I learned to type in my childhood it happened entirely in a vacuum, I never used techniques like touch typing, so I ended up with my own idiosyncratic way of typing QWERTY. I only used two (left) or three (right) fingers for the main letter keys, and the pinkies for things like Shift and Enter. Notably I hardly ever used the ring fingers except for certain muscle memory sequences. It worked pretty well, I could type comfortably at 80wpm, peaking at around 100wpm, but of course, “it could be optimized.”

Every nerd with high enough openness probably goes through a phase where they, too, want to optimize they keyboard usage in some way. For me that optimization came in the form of switching to a better (more comfortable) keyboard layout while simulaneously learning proper touch typing. Like a full reboot of my muscle memory.

The two main competitors at the time were Dvorak and Colemak (then a relative newcomer, but quickly gaining popularity). I tried Dvorak briefly, but found it was incredibly painful to learn, progression was dauntingly slow, even after several days. In contrast, Colemak was very pleasant from the beginning, and early progression was very fast. When it became clear that Colemak would be my new layout of choice, I went the extra mile by creating an early version of the above-mentioned layout which I could install on Linux and Windows. In the end, even having later looked at layouts like Workman etc., I’m very happy with my choice1 of Colemak.

I started out with a singular mindset of wanting to get faster (which I did; my peak with Colemak is around 125wpm), basically tuning out layout enthusiasts when they started to talk about “ergonomics.” Ergonomics are for old geezers who take breaks every hour, who need to eat real meals for their digestion, and can’t hack an 18 hour code session. The zoomer mindset.

I’ve since predictably changed this very naïve mindset2. Now I too would say that comfort is the singularly most important factor that should inform anyone’s decision vis-á-vis switching layouts. And Colemak is so, so, so much more comfortable than QWERTY. It just feels good to type with it, in a way that QWERTY never did.

Half the Value of Colemak Is a Gimmick

The single, most important thing about Colemak is that it puts Backspace on Caps Lock.

People are not aware of how much they use Backspace. It’s extremely likely one of your top five most used keys on your whole keyboard (this includes space, Enter, everything). No matter who you are, no matter how good you are at typing, it’s still a pretty safe bet.

Any layout would instantly be improved by an order of magnitude simply by swapping these two keys. The original placement of Backspace deep in Timbuktu is mind-boggling.

Surviving Being a Snowflake

Choosing to employ a non-QWERTY layout also means you’re playing on hard mode when it comes to being a software user. Not that many people are mindful of the existence of non-QWERTY layouts, and there’s lots of badly written games and software that is entirely coupled with the layout, without any way of modifying it.

A big customization pain point can be vim and evil-mode. I refused to settle for hjkl-navigation on Colemak, even if that is something that is often recommended.

Inspired and enlightened by the configuration of a certain theniceboy@github, I learned the modifications necessary aren’t daunting. It turns out only two sets of four keys need to be cycled in behavior to end up with a good Colemak vim/evil-mode keymap.

Instead of using hjkl on a single row it uses

     | l |
  | n | e | i |

Which I actually prefer, since it’s so similar to the regular cursor keys or the WASD-keys (QWERTY gaming).

The swapped chains are:

u -> k :: 'u' loses <UNDO>, becomes <UP>
k -> i :: 'k' loses <UP>, becomes <INSERT>
i -> l :: 'i' loses <INSERT>, becomes <RIGHT>
l -> u :: 'l' loses <RIGHT>, becomes <UNDO>

For the first step. Note that we unfortunately have to move i. It’s hard to avoid that. And the second chain we cycle is:

h -> e :: 'h' loses <LEFT>, becomes <WORD-END>
e -> j :: 'e' loses <WORD-END>, becomes <DOWN>
j -> n :: (OPTIONAL) 'j' loses <DOWN>, becomes <SEARCH-NEXT>
n -> h :: 'n' loses <SEARCH-NEXT>, becomes <LEFT>

Note here that the functionality of n (next regex search hit) ends up on the very painful j, that’s why I recommend also using something like EasyMotion, Clever-f, Sneak, etc. and using ; and , as a unified interface for navigating search hits. That way we can drop j entirely, and it becomes a ‘free’ key for customization.

  1. The only gripe I have with Colemak is the placement of g. It feels like a rather painful position, and I use it quite a lot (editors, programming, Norwegian). I would probably switch b and g, but have never done so.

  2. Speed is not a bad metric though, because the better the ergonomics, the higher the ceiling is likely to be.