Left Wrist Motion Pain; vi Esc Syndrome
Perm url with updates: http://xahlee.org/emacs/vi_esc_syndrome.html
Left Wrist Motion Pain; vi Esc key Syndrome
Xah Lee, 2010-08-16
In the past month, my left hand wrist started to feel funny. Especially yesterday after several hours of heavy coding. Not pain yet, but distinctively something is wrong. The closest description is tingling, and tingling sensation is the first symptom to RSI.
(Been using emacs for like 16 hours per day for the past 6 months. Especially in the past 3 months. No it's not a exaggeration. Hard to say the exact hours my fingers are actually typing, but literally from the time i wake to the time i sleep i'm in front of comp, and about half of that time i'm inside emacs.)
I consider myself a keyboarding expert. I use a fancy ergonomic keyboard (since 2005). I use the Dvorak Layout (since ~1992). I use a ergonomic emacs keybinding system (since 2007). I have extensive system-wide custom-designed shortcuts to save keystrokes. I read extensively on all things related to keyboard, in the past 20 years. (See: All About Keyboards, Keyboard Layouts, Shortcuts, Macros.)
So, it is a slap to my face, that i might be developing repetitive strain injury (RSI). I am quite puzzled on what's the cause.
Is it the emacs chording? No, i don't find any evidence tracing to that with my system. Is it lack of breaks? No, i take at least 5 min walk every 2 hours. I thought it's because i played too much first-person shooter in Second Life. (because i use left hand for mousing. (btw, i use 2 mouses, one for each hand, and i alternate mousing hands without thought, whichever comes handy at the moment. Been doing this since 1995 or so.)) Certainly playing first-person shooter didn't help, especially when you get intense and got immersed in the game to kill your opponents, and this can happen for hours unconsciously.
Perhaps, 10+ hours a day keyboarding is just too much? I was guessing the problem is Second Life combat, but can't be sure. But today, i found out why.
It's the goddamn keys like 1, 2, Tab, Esc, `. In a sentence, perhaps it is best understood as “vi Esc key syndrome”.
One way to know your problem is to have a camcorder pointing at your hands for the whole day. Then, play them back with increased speed. When you watch the video, you can clearly see what's the most repetitive motion. (This technique is widely used in athlete training to monitor habits and movements. (i know because i was in college swimming team in around 1992 to 1993, and have been subjected to this by our coach Ron Oburn, once.))
I don't have a camcorder and didn't bother to do this. Nevertheless, little hints and thoughts made it clear.
The 1, 2, Esc, Tab keys are on the extreme left side of the keyboard. Let's say the 1 key, which is the most frequently used digit. How you press that depends on person. You can flatten your palm and extend your pinky. This is the method traditionally taught in touch-typing. However, i remember about a year ago i find this way to be too slow and cumbersome for the keyboard i am using. I press the 1 key by bending my wrist leftward, then use my middle finger to press 1. This means i move my wrist in a horizontal left/right motion a lot.
Also, in ErgoEmacs, splitting window is done by Alt+2, and expanding the current pane is done by Alt+1, and closing all other panes is “Alt+Shift+1” (Alt+!). Window expanding and spliting are two of the most frequently used emacs operations. (See: Emacs's Command Frequency) So, that adds significantly to my wrist left-right movement.
(Note: the original design of Dvorak layout has numbers arranged like this: “7 5 3 1 9”, “0 2 4 6 8”. The 1 would be today's 4, which is most easily typed for that row for left hand)
In the past few days, before this discovery, i have attempted to reproduce any hand movement that would cause this tingling sensation, but just couldn't pinpoint. Now i know. Now, if i just emulate the motion of my left hand trying to type the 1 and back to normal typing position, TINGLE! Move my hands away from keyboard, then try to move my wrist left/right, Tingle! Don't laugh, because it's very unpleasant. (and i shudder to think about it, because many programers have permanently damaged their hands by typing.)
The solution is quite simple. Here are some suggestions.
• Do not press the 1 key using index finger. Same for all the other keys there (Esc, `, Tab, 2). Press them by moving your whole arm to avoid wrist bending. (Pressing them by extending pinky will probably cause a different problem.)
• Avoid heavy use of these keys. If your software need them frequently, remap them elsewhere using keyboard macros software. Map them to function keys, or modifier combo with easier keys in positions of 3, 4, 7, 8, 9. If it means slower operation, keep in mind that your hand health is more important than saving of little seconds.
(for key macros, on Windows you can use AutoHotkey, IntelliType. On Mac you can use Mac OS X DefaultKeyBinding.dict, Keyboard Maestro at keyboardmaestro.com (trial ware), Quicksilver at blacktree.com (free). Also QuicKeys (commercial) (startly.com) is available for both Windows and Mac. )
This also means, my ErgoEmacs keybinding will be changed. Alt+1, Alt+2 won't be for splitting windows. When i designed them, those choices were sloppily chosen without much thought. They were based on mnemonic, similar to emacs's default C-x 1, C-x 2. But now i know how bad these choices are. I'll create a new version with new binding for spliting window functions. For now, you can put the following in your emacs init file:
;; remove some default (define-key ergoemacs-keymap (kbd "M-1") 'nil) (define-key ergoemacs-keymap (kbd "M-!") 'nil) (define-key ergoemacs-keymap (kbd "M-2") 'nil) (define-key ergoemacs-keymap (kbd "M-@") 'nil) ;; new (define-key ergoemacs-keymap (kbd "M-3") 'delete-other-windows ) (define-key ergoemacs-keymap (kbd "M-0") 'delete-window) (define-key ergoemacs-keymap (kbd "M-4") 'split-window-vertically) (define-key ergoemacs-keymap (kbd "M-$") 'split-window-horizontally)
The above takes out the ispell-word command. If you use that, remap it somewhere. I remap it to the keypad's 4. (<kp-4>) (other numbers are already used. I use the keypad keys as function keys. If you don't use Calculator, the keypad can serve as extended function keys. Can be system-wide or app-specific.)
I'm sooo very happy i discovered this problem.