Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remap Vim keys to avoid RSI in left hand

I always suffered from RSI in my left wrist (see here) and I thought it was because of the twisting motion associated with hitting the ctrl and shift keys. Therefore, I went ahead and bought an Advantage Kinesis keyboard shown below:

enter image description here

However, even with this keyboard, and foot pedals, and mapping the shift key to the Back Space, I still have RSI, again only in my left hand. Then it occoured to me, a great deal of the movement keys are associated with left hand. Here is a non exhaustive list of the things on the right hand, and then the left hand.

Right Hand:

  • p a simple paste statement, almost always used on its own
  • o write above/below current line, almost always used on its own
  • i write at cursor, almost always used on its own
  • u undo, almost always used on its own
  • y yank, used with a motion command, but only a few motion specifiers on right side (ie. (, ), i...)
  • h, j, k, l, single character motion, seldom used.

Now observe

Left Hand:

  • w, e, b motion one word. Very often used with a number, or pressed multiple times.
  • t, f, $ all combined with keys like y, d, or v
  • Ctrl w + h, j, k, or l, for moving windows, and requires a jerking motion with your left hand.
  • Ctrl x Ctrl f omni completion (IIRC)
  • Ctrl f Ctrl g find file under cursor

Now I am sure this is a biased list, but it gets my point across that a great deal of the commonly used motion keys and a few other difficult combinations are situated on the left hand side of the keyboard.

My question is this, is there a non reinventing-the-wheel way to do this? For example are there any libararies that do this? If not, if I switch to DVORAK will this solve any of the problems I mentioned?

like image 518
puk Avatar asked May 06 '13 23:05

puk


2 Answers

To answer your Dvorak question about the keys you mentioned:

p, o, i, u, y, j, k, e, $, x are typed with the left hand. h, l, (, ), w, b, t, f, d, v, w, g are typed with the right hand.

So looking at what moves where:

Stay on Left  |    Move to Left   |  Move to Right   |  Stay on Right    
----------------------------------------------------------------------    
e $ x         |   p o i u y j k   |  w b t f d v w g |  h l ( )

They keys you use are still mostly evenly distributed between left and right hands, but most of the solo-keys are now left-hand, and most of the chorded sequences are right-hand.

Also, the process of learning Dvorak will slow you down significantly, which can help to reduce the strain on your wrists while you make the transition.

You can enter a sample of what you regularly type into websites like http://patorjk.com/keyboard-layout-analyzer/ , and see how much more or less distance your fingers have to travel under different keyboard layouts. (There are other neat metrics to look at, too. Click the tabs on the left and explore!)

like image 87
Bill Avatar answered Sep 28 '22 04:09

Bill


I don’t like the control keys either so I remapped the most used ones to <space>.

Example:

nnoremap <C-W> <space>w

So instead of doing Ctrl+Wh, I do Spacewh, and it works really well.

like image 25
mb14 Avatar answered Sep 28 '22 05:09

mb14