A step towards reducing Emacs Pinky

As someone who spends most of the day attached to their keyboard I’m fairly sensitive to RSI inducing things. One thing I do suffer from is what’s colloquially known as “Emacs Pinky”. As the Ctrl is the start of practically every editing command in Emacs it’s the left little finger that spends most of it’s time stretched out and after a long heavy coding session can be more than a little sore.

I’ve made adaptations including re-binding the useless Caps Lock key to being an alternative to Ctrl (although my use of it is sporadic). However one other culprit is the incredibly useful GNU Screen.

I’ve been running with the default bindings for some time which use the Ctrl-A sequence as the command sequence. This is especially troubling when you have multiple nested screens. Today I finally cracked and made the decision to break out of this bad habit. So starting today I’ve chosen the backtick (`) character for the escape sequence. This makes the normal (and most frequent) screen action of switching screens a two stroke press without having to hold any control key down. We shall see how long it takes to retrain my muscle memory.

Does anyone have any tips for reducing strain on the little finger inside Emacs itself? Sometimes I wonder if it would be easier to replace Ctrl actions with a double tap on the space bar before going for the modifier key. Is that even possible?

I found this entry on superuser useful for other screen config tips.

15 Comments

  1. My approach is to remap the Ctrl/Alt/Windows keys to be in that order in increasing distance from the spacebar. The magic xmodmap that I use looks something like the following:

    keycode 64 = Control_L
    keycode 108 = Control_R
    keycode 133 = Alt_L
    keycode 151 = Alt_R
    keycode 37 = Super_L
    keycode 105 = Super_R

    clear Shift
    clear Lock
    clear Control
    clear Mod1
    clear Mod4
    clear Mod5

    add Shift = Shift_L Shift_R
    add Lock = Caps_Lock
    add Control = Control_L Control_R
    add Mod1 = Alt_L Alt_R Meta_L Meta_R
    add Mod4 = Super_L Super_R
    add Mod5 = Hyper_L Hyper_R

    (I think I’ve successfully got rid of the other unrelated lines). Obviously, this depends on the keycodes of the relevant keys. I spent several afternoons trying to get xkb to do this “properly” for me a couple of months ago and failed miserably…

  2. How far are you willing to go? I bought a Kinesis Advantage Pro keyboard just for this purpose. I remapped the keys a bit, and now the ctrl key is directly under my left thumb. Worth the cost? I thought so; wound up buying another one for work.

    • Thanks for the tip. I’ve currently got a Microsoft Ergonomic keyboard at work so there are a bunch of extra keys on it, just not any extra around the thumb areas. I’ll certainly consider the Kinesis, maybe I should put it on my wish list for Christmas :-)

    • I have the same keyboard, and it allows you to put a control and alt key under each thumb. This is ideal for Emacs.

  3. Bad habits seem to have saved me from Emacs Pinky. I started using emacs before i learned to really touch type and never got into using my pinky. I actually use my ring finger for control and meta and then shift over one for when i need to touch type.

  4. You could do ` for next and M-` for prev. I’m going to try out M-i for prev and M-o for next, since I don’t run emacs in screen much and I don’t use those combos in emacs very much. For a while I used function keys to go directly to a numbered screen, so f1 instead of C-a 1.

    • Where I noticed it most was running emacs on my mail server under two nested screens. Ctrl-a-a-a to got to the front of line!

      My access to screens tends to be random access so going directly so far seems faster. I did consider the Function keys but I’m never quite sure what travels across ssh sessions with them.

  5. I would bet that twisting your hand to get at ctrl is your problem. If you need to train yourself to use cap lock instead, just lever off the cap of the original ctrl. The feedback you get through your fingertip will have you weaned off ctrl in a few days.

  6. At work I use a Kinesis Advantage Pro just like David. It’s worth every penny. I can recommend buying the pads for your wrists as well, the base of my hand used to get sore from resting at the keyboard until I attached the pads.

    At home, I user viper mode to reduce holding down Ctrl.

    Also I have bound next-line and prev-line to M-n resp. M-p (as well as C-n and C-p).

  7. Something I do and which very few mention, is to simply use the thumb or other finger to press the right Ctrl key and then type the rest of the command keys with the left hand.

  8. It’s not possible with all keyboards, but I’ve always pressed the left Ctrl with the edge of my palm — when I press C-a with one hand, for example, my left pinky finger is pressing the a key and the other finger tips remain on the home keys. Feels very comfortable to me and I’ve never noticed any ill effects.

  9. Sometimes I wonder if it would be easier to replace Ctrl actions with a double tap on the space bar before going for the modifier key. Is that even possible?

    It’s almost certainly possible—whether it’s a good idea is another story. If you are interested you could look at the code for cua-mode which, if I understand correctly, uses timing on C-x and C-c to distinguish between cut and copy, and their use as prefix keys.

  10. I’m planning to learn viper keybindings. My pinky thanks me every time I use j and k instead of Ctrl-n and Ctrl-p in dired mode.

    • Single keys are very useful for some things. I made my own variation of diff mode where (a)pply, (r)evert and (t)test were single key-presses (I never actually edit patches in the diff). I’m also bound / and * in the compile buffer for easy jumping back and forth between compile errors.

      However I’m not sure I could handle the modal changes viper want in my normal code editing buffers.

Comments are closed.