If you’re willing to exchange a bit of memory for a lot less strain on your wrists, let alone work speed, this is your lucky day. In this post, I will describe how I’ve tuned my everyday work environment to a point where it feels completely unnatural for me to have to move my hands away from the home row. And that’s a good thing—the less often my hands have to go anywhere, the less I am at risk of having painful wrist trouble later in life.
So what’s the are the keys to all these benefits? You might laugh, but in fact they are H, J, K, and L. Namely, the cursor motion keys in Vi. It may seem strange to tell people to use H to move to the left, J to move down, K to move up and L to move right, when there are these handy arrow keys right next to where your hands typically sit. But the problem is that your hands have to move quite a ways, and if you’re like me, you also flex your wrist somewhat unnaturally just to reach those. On the other hand, HJKL are right there on the home row, if you touch type. No wrist movement required.
Now, much of what you do every day on your computer involves moving around. So why not make use of these convenient motion keys in as many places as possible? Read on for a slew of suggestions.
Text Editor
First of all, if you aren’t already a convert, you might want to consider switching to Vim as your text editor. The learning curve may be steep at first, but with time you’ll become more of a text surgeon than you’ll realize, and many rather complex text editing tasks will commit to muscle memory. Delete a word? “dw” Change a word? “cw” Delete a line? “dd” Change a line? “cc”. If you edit text a lot, this is time well spent.
While on the topic of Vim, here are a few tricks that I find valuable:
- Use
*
to search for the word under the cursor. - Use
Control-n
to search for completions of the word under the cursor. This is especially worthwhile if you write code with rather long, descriptive names. - Vim requires you to hit “Escape” a lot. That’s another nasty twist of the wrist, until you discover that Control-[ does the same thing.
Window management
- If you use multiple desktops, find a way to configure your window manager to move from desktop to desktop by using Control-Alt-VI Motion Key.
- One big use of the mouse is moving windows you just opened to the right place. However, with the following patch, the window manager Compiz can move (and resize) windows around using Vi motion keys.
Internet
- To me, this is today’s big discovery: The Vimperator. This makes Firefox look and behave a lot like Vim. What this means is that you can use a web browser without ever moving your hand to the mouse. Important problem: How do you click on a link then? Vimperator’s solution, to me, is pure genius. By hitting F, every link on the page shows a little one- or two-letter shortcut (such as “HN”). Type that, and you’ve followed the link. Shift-H (remember, that’s Vi-Left) and Shift-L (that’s Vi-Right) allow you to navigate through history. If you know Vim, you’ll feel right at home in Vimperator.
- Also, Google Mail and Google Reader support Vi motion keys, once you enable them.
Desktop environment
- I use tabbed X terminals a lot. Alt-h and Alt-L make nice shortcuts for switching to the tab on the left or on the right. If you use a GTK-based terminal, you might find yourself unable to change your keyboard shortcuts until you use this trick.
- Lastly, I find that Control-Alt-semicolon (at least on a US keyboard) makes a nice shortcut for opening a new terminal.
May your wrists find this information useful! :)