In Clojure We Trust

A piece of intertube about the Clojure programming language, algorithms and Emacs.

A Better Coder Layout for the ErgoDox EZ Keyboard

I’m a happy owner of the ErgoDox EZ, an awesome ergonomic mechanical keyboard. The Ergodox can be configured with multiple layers. The first layer is generally configured to be the one with the letters and symbols used for the standard layout (like QWERTY, AZERTY, or Colemak). Often the second layer is the so-called “coder” layer with symbols for programming such as parenthesis, brackets, semi-brackets etc. The third one can be configured to control the mouse and the multimedia functions of the operating system with the keyboard. Everything is configurable and additional layouts can be added with an online configurator or by compiling a C file for the firmware. Each layout is accessible by pressing a key; something similar to pressing alt or shift on another keyboard, where pressing these keys allow to access a new set of symbols.

Before ordering the ErgoDox I was preparing a lot to find an optimized layout suited for my needs. It happened that Colemak Mod-DH was perfect for me. Similarly, I wanted an optimized coder layout for my programming needs. I used some simple Unix tools to calculate the frequencies of special symbols appearing in various source codes. I chose projects which either I or my (ex-) colleagues worked on, having a size bigger than 5KLOC and coming from different language families:

  • one Clojure project (Lisp family)
  • one Python project (significant structural indentation)
  • one JavaScript project (curly brackets)
  • one Haskell project (ML family, Haskell, PureScript)

I aggregated various statistics and used them for manually designing the coder layout. I did not analyze my shell commands, however the place of the slash symbol in my design allows to easily type directory paths. I designed the layout according to an effort matrix but I did not go as far as to test my design with a software. It just felt (very) good and I needed a fast solution to be able to use the ErgoDox as quickly as possible.

It took little time to learn the layout, partly because I designed it but also because there was no conflicting mental model in my head, unlike when learning a new optimized layout where the brain needs to “unlearn” the previous layout from the new one.

Symbols are balanced, as much as possible, between left and right. “Weaker” symbols (such as “?” or ‘) are on the left and “stronger” symbols (“!” or “) are on the right. I placed all punctuation symbols on my first layer (, . ; : ) so they do not appear on the coder layout.

In the end I think the default coder layout proposed by the ErgoDox EZ is a very bad one considering the ergonomics. It should be seen as a showcase of the possibilities offered by the ErgoDox and an invitation to taylor a layout for users’ needs (which is the idea of this product).

My exact final layout can be found on my GitHub and was not submitted back to the original project yet, as I still want to do a few improvements. I recreated a similar design to mine with the configurator available here. If you like it, I would appreciate a short comment.