Enhance Emacs Ergonomics Under X: Happy Hands!
1. Executive Summary
Describes customizations under X that makes my hands happier. Leverages features and (mis-features) of modern-day laptops to break old habits and reduce chording in common cases.
I have been using Emacs for 33 years now and at this point, much of my Emacs usage is based on muscle memory. This has its good and bad points; the good ones are obvious; I dont need to think about what keys I press. But it also has some downside; I likely press more keys than I ought to for a given result.
- I learn to use Emacs on a TTY (text console) and all my habits are driven by the keys available on a terminal.
- Under X you have more keys available, but I resisted running X until around 2008.
- Now, I almost never run Emacs on a TTY, except when I need to rescue a broken X setup.
- after turning
ControlI forgot about the other modifier keys; I press
- I also defined
C-;and friends as additional Emacs prefix keys.
- The above saves your hands because you dont chord using the modifier keys on the bottom row.
- But you waste 6 modifier keys on a laptop where keys are in short supply.
3. Leveraging Current Keyboard
- The motivation to leverage the laptop keyboard is higher now, since with the arrival of the pandemic, that has been my primary (only) machine.
- I can chord without thinking using the modified
Control. But I also noticed that I choard a lot.
- Chords I use most often as a prefix:
C-e— Emacspeak prefix,
C-x— emacs command prefix.
- Looking at the bottom row of the laptop keyboard, there are three modifier keys to either side of the spacebar.
- Adding the left and right
Shiftmodifiers gives 8 keys that could do something useful when not used as a modifier key.
4. XCAPE: Turn Modifiers Into Buttons
I discovered xcape a while ago, but had set it aside for future exploration; The observations made in the previous section indicated that that time was now!
So here is my xcape Setup and associated XModmap as of the time of writing:
4.1. What This Does:
Controlby itself sends
Superby itself sends
Altby itself sends
Shift_lby itself sends
Shift_Rby itself sends
Note that the
XModmap file does the work of changing the
key on my laptop to be
Super_L for symmetry. So the bottom row of
keys now look like this:
Looking at the above, it's tempting to turn the
SpaceBar into a
modifier — but I've resisted doing that for now.
- A week later, I'm slowly retraining my muscle memory — I use the new affordances described here about 25% of the time.
- I find myself using the new features in the second half of the day when my hands are more tired.
- The effect of thinking before pressing a key reminds me of the time I learn to use dvorak for text input; I still do so sometimes to give my hands a break.
- The new mappings give some surprizing results e.g.,
shiftsaves the buffer, but buyer beware,
- Am sure more muscle memory will emerge for oft-repeated tasks.