Emacs, RSI, My Experiences

Perm url with updates: http://xahlee.org/emacs/emacs_rsi_my_experiences.html

Emacs, RSI, My Experiences

Xah Lee, 2010-09-05

Recently, i had starting symptoms of RSI (repetitive strain injury). (For detail see: Left Wrist side-to-side Motion Pain; vi Esc key Syndrome) This page is some practical emacs and keyboarding advices i learned due to this experience.

Keyboarding Advices Are Qualitatively Different Depending on Typing Duration

I learned that typing advice matters depends on just how much one types a day. If you just type less than 1 hour a day like vast majority of computer users, qwerty or bad habits or bad keyboard is completely healthy! You could do this for 10 years and never have any problem.

Big difference from coders who actually actively have fingers pressing keys a accumulated total of 3 hours a day, to some who have 10 hour sessions and actually type 6+ hours a day, and compared to data entry clerks who has fingers pressing keys for ~8 hours a day fast and non-stop.

For the latter, a special ergo keyboard like Kinesis or Maltron becomes necessary.

All programers have strong opinions about keyboarding, but how much one really types makes the advice qualitatively different. Advice from those typing 5 hours per day is not applicable for those typing 10 hours a day, and advices from the 10-hours experience may not be suitable for those typing just 5 hours, even if both are sound ergonomic advices. (you'll see why below)

Tab, Enter, Backspace Key are Problems

I learned that the PC keyboard really have serious problems especially with the Tab, Enter keys, Backspace, and the right side Shift key. Even with Microsoft's ergonomic keyboards.

They are all pressed by stretched pinky. The Enter and right Shift requires a stretched pinky because there is 1 extra key after the right pinky's home position. (the apostrophe 「'」 key.) (Some euro lang layouts such as QWERTZ and AZERTY have 2 extra keys in between!)

This is the first time, that i realized from actually hand experience, about the problem of these keys. To press Enter or right Shift, the right hand does a combination of stretching pinky or side-to-side wrist movement. Do this for 8 hours a day every 5 seconds; hello RSI!

One might think these keys are not used that often, but from emacs command frequency study , programers actually do a lot editing and not simply data entry. The average for editing keystrokes is like 48%! (for each person, it varies from 20% to 80%, depending on whether you are for example heavily writing a lot emails, or much reading/editing code.)

(Maltron, Kinesis keyboards solve this problems by having thumb cluster keys for these)

For more detail on this, see: Keyboard Hardware Design Flaws and Kinesis Contoured Keyboard Review and RSI.

Emacs Tips for 70-Hour Week Sessions

The following are some specific emacs advices. Note that i already use:

So, the following advice may be applicable only if you already do the above and have to type 70-hour weeks for many weeks.

• I started to remap extensively my personal bindings that involves a Shift. Get rid of them. Especially those needs the right shift. (i.e. the letter is on the left side of keyboard)

• I started to aggressively make alias to commands i use often. The aliases are 1 to 3 letters long. Put alias file on your Emacs's Bookmark so you can open them right away and define new ones the moment you find a command that you are using a lot today or past days. (i stopped worrying about cluttering alias space or managing to remember them. It doesn't seem to be a practical worry.)

I use aliases because i already have about 200 personal hotkeys. Single key spaces are mostly used up (including single keys on the number pad), key chord combinations are harder to remember.

• Do the same for abbrev, as well as your custom keybinding file. The point here is that you want a dynamic and instantaneous system that let you easily change or add new shortcuts, alias, abbrevs, and you should get a habit of adding new ones whenever you noticed a command or word that you've been using frequently in the past few days. (you will usually notice it. For command, due to the fact you have to press Tab a lot to command completion (e.g. elisp's buffer-substring-no-properties) , and for long words like “environment variable” or “internationalization”, “Microsoft”, “Windows”, “GNU Emacs”, “software”, or “http://ergoemacs.org/”, you'll notice.)

• I started to type enter by 【Ctrl+m】 half of the time. (in fact 【Win+m】 is also Enter now thru AutoHotkey.) Partly to alleviate the burden on right hand, partly to vary the muscle usage. And yes, sometimes press Enter by moving your whole hand, as in hunt-n-peck.

Note, unless you are on a laptop, don't press Ctrl with pinky, and it's probably not a good idea to swap Ctrl with Caps Lock. (See: How To Avoid The Emacs Pinky Problem.)

• Remapped Caps Lock to Tab now. (or, i could also use 【Ctrl+i】)

• Seriously started to use yasnippet template system a lot. Made it a habit to create new templates constantly and instaneously. Usually with just 1 to 3 letter abbreviations to invoke them. Don't fret about abbrev consistency, template design, etc. The point here is that it's for your personal use, and that it immediately saves you lots of typing.

For example, instead of “div.class” for 「<div class="...">...</div>」, you can make it just “d.c” or even “dc”.

• I realized that bookmark, dired, all can use mouse. I try to switch to mouse more often. Yes the keyboard is faster but not good if repeatedly used for 10+ hours a day without hand muscle changing exertion pattern. Sometimes also use mouse to select text.

• I started to use less efficient keys sometimes, e.g. the arrow key and 【Ctrl+arrow】 for cursor movement, page up/down, .... To get hand away from the same muscle usage on touch typing position.

• Alternate hands for pressing the Space bar.

My problem is only with left hand. On Dvorak, right hand actually does 14% more typing. I realized that i always press space with left thumb. Now i switch to right thumb. Perhaps eventually want to develop a habit of alternate hands for space bar after each word. (the space in language is used more frequently than any letter)

• I switch keyboards during a day. My 3 fav are Microsoft's Natural Ergonomic Keyboard 4000, Comfort Curve Keyboard 2000, Wireless Natural Multimedia. Right now am on comfort curve, which has laptob style flat keys. Change keyboard is for the purpose of varying the muscle usage pattern.

• In emacs keybinding, forget anything about consistency or ease-to-remember. One principle and one only: map Command Frequency to ease of the key.

• Do not bother with prettying up little formatting in code or deleting a trailing space, alignment. Avoid un-necessary typing. Use automatic formatting tool as much as possible. (e.g. emacs delete-trailing-whitespace and much others.)

• Set Windows's mouse behavior to be auto-raise. That is, when your mouse hovers on a window, that window automatically comes to the front. I find this convenient.

ErgoEmacs Viper Mode

I seriously considered creating a ErgoEmacs viper mode. I'm familiar with vi's “modal” methods of editing, but have always kinda put off of thinking about whether the vi modal method is more efficient or ergonomic. With my RSI incident, i put heavy thought about it, and i think yes, the modal method is actually more efficient and ergonomic.

I think i'll invest time in this in the future.

(However, note that by default the Esc for switching mode is a FAST way to get RSI. Also, the default command keys in vi are NOT optimal. (see: Emergency vi (vi tutorial)) Vi's keys, like emacs, are largely historical happenstances without any thought on efficiency or ergonomic. (see: Keyboard Hardware's Influence on Keyboard Shortcut Design.) )

Kinesis Keyboard

The Kinesis Contoured Keyboard solves many major PC keyboard problems. I think i may get it.

I think the above sums my recent experiences.

Again, this needs to be emphasized: all the above advices is for someone who spend some 10+ hours in front of computer for 3 or more years. If your keyboard needs is not this heavy, some of the above advices are not applicable, and in fact less efficient (e.g. switching keyboards in a day, constantly add new keyboard shortcuts, use the mouse, etc.)

Also, my heavy use of keyboard is mostly writing essays and tutorials in html. So, there's a lot of heavy data-entry tasks (meaning: just keep typing a lot of plain english text.). Because i have extensive shortcuts and commands to insert html tags or special chars such as 〈「【([{",=+-"}])】」〉, my typing problem is probably mostly due to heavy typing, not much from emacs chording.

Was this page useful? If so, please do donate $3, thank you donors!

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs