I want to learn the emacs keybindings, mainly for moving around in a block of code, and selecting text. What's the best way to do this?
I essentially type all day. A good portion of that time is spent programming (probably 6 hours a day averaged over a week). Recently, my wrists started bothering me. A few days of rest from typing, an ergonomic keyboard, and
AntiRSI fixed it (as in, it doesn't hurt anymore), although I plan to be more careful about it from now on.
I think much of the problem is caused by the way I navigate through code though. I use my mouse much too often. I
edit code much more often than I
write new code, but I haven't learned the keybindings for moving around and selecting text, so I mainly use the mouse.
I work in Mac OS, mainly in XCode or Textmate, and I have my system set up to use the Emacs keybindings for navigation. I even wrote a little chart of the keybindings and taped it to my monitor. The problem is that it's still much easier to use my mouse (especially for operations that are like: copy this line of code over here, and change the name of the first argument to this).
Also, I find selection to be difficult to figure out. I don't understand how to get the selection I want (and this is a large part of why I don't use the keybindings), so I just don't use it, because I get much better results with the mouse.
How do I overcome this barrier and actually learn the keybindings well enough to use it over the mouse?
It would be ideal if I could learn them in my day-to-day typing, but if you have a method that requires me to sit down for a few hours and just
learn them, I could give that a try too.
Thanks!
Actually, if you're using the GUI tools, why not use the default Apple selection bindings? They're easy to understand:
Arrow keys = move char by char
Option+left/right arrow = move unit by unit (eg word)
option+up/down arrow = move to start/end
Apple+ left/right arrow = Move to start/end of line
If you want to make a selection from your starting point, just add shift.
Much more comfortable than CTRL-laden zaniness. It's the pinky key! Ugh.
posted by bonaldi at 11:20 AM on March 5