19 Ergonomics

Long Emacs sessions punish the modifier-holding fingers. Protesilaos Stavrou’s keyboard ergonomics writing argues for replacing held modifier chords with one-shot modifiers — tap-then-press — so that the only fingers under load are the ones actually typing characters. Most of Prot’s solution lives in keyboard firmware (split keyboards, QMK one-shot mods, thumb clusters). The Emacs side of the same idea is repeat-mode plus a small set of repeat-maps.

This page explains what Jotain enables out of the box, how to extend it, and what to look at next if you want to push further.

19.1 Repeat-mode: the Emacs-native one-shot

repeat-mode is built into Emacs 28+ and enabled globally in init-core.el. After running a command tagged with a repeat-map, Emacs installs that map as a transient overlay: the bare trailing keys keep running related commands until you press anything else (or 2 s pass — configured via repeat-exit-timeout).

The everyday wins are all built-in:

Type onceThen keep typingWhat happens
M-oo o oCycle through windows
C-// / /Undo, undo, undo
C-x →→ →Cycle through buffers
M-g nn n nJump through compilation errors
C-x oo Oother-window forward/back
C-x ^^ ^ vResize the window, then correct

These come from Emacs itself; Jotain just turns the mode on. Run M-x describe-repeat-maps to see every active map at any moment.

19.2 Jotain-specific maps

Window resizing is covered out of the box too: Emacs ships resize-window-repeat-map, so C-x ^ ^ ^ v overshoots vertically then corrects, and C-x } } } { { widens then narrows horizontally — all without re-pressing C-x. shrink-window has no default key binding, so v only activates inside the repeat overlay (after another entry command has already fired).

The one map Jotain adds itself (in lisp/init-keys.el, on Emacs 31+) is jotain-window-layout-repeat-map under the C-x W prefix: it repeats the new window-layout-* frame transforms, so C-x W r r r keeps rotating the whole window tree. The 2-second repeat-exit-timeout (in init-core.el) clears any repeat overlay automatically — no C-g needed.

19.3 Extending repeat-maps

To add your own, drop a defvar-keymap into lisp/init-keys.el (or the module owning the commands) and tag it with :repeat t. Every command bound in the map gets repeat-map set automatically. For example, paragraph navigation:

(defvar-keymap my-paragraph-repeat-map
  :repeat t
  "{" #'backward-paragraph
  "}" #'forward-paragraph)

Now M-{ { { walks backward through paragraphs without holding Meta.

19.4 Pinky-stretch escape hatches Jotain already takes

A few existing bindings are quiet ergonomic wins:

19.5 Beyond Emacs: the rest of Prot’s advice

Most of Prot’s recommendations are outside Emacs’s reach:

These are out of scope for an Emacs config, but worth knowing about when the in-editor wins above stop being enough.

19.6 Optional: modifier-bar-mode

Emacs 30 ships modifier-bar-mode, a tool-bar widget that lets you tap Ctrl/Meta/Super/Hyper and have it apply to the next keypress — a clickable one-shot modifier. Jotain disables the tool-bar entirely in early-init.el for a clean UI, so this is off by default. To enable it for yourself, add to your custom.el or a personal init fragment:

(tool-bar-mode 1)
(modifier-bar-mode 1)

19.7 Further reading