Option-Arrow Word Movement in Terminal

Want to use the option-arrow key combo to move through text in Terminal just like you do in virtually every other Mac application on the planet? Boy, I sure did. Luckily, Allan Odgaard, the author of TextMate, has figured out how, and it’s a breeze. In a nutshell (no pun intended):

  • Open Terminal
  • Open the Inspector (command-i)
  • Go to the “Keyboard” section
  • Add a new key binding by pressing the “Add” button
  • Set “Key:” to “cursor left”
  • Set “Modifier:” to “option”
  • Set “Action” to “send string to shell:”
  • In the text box, press the escape key to get the “\033″ text, then hit the “b” key, for “back”
  • Click “OK”
  • Repeat this process for forward movement, using “cursor right” for the “Key:” setting, and “escape-f” for the forward key binding
  • Be sure to click “Use Settings as Defaults” if you want the change to be permanent

The Terminal Inspector: Finally Proper Word Movement
(click for larger view)

That’s it! Now hitting option-left-arrow will move the cursor back one word in Terminal, and, of course, option-right-arrow will move it one word forward.

Sweet!

3 Comments

  1. mat x
    Posted February 8, 2006 at 8:06 AM | Permalink

    Ya, baby. Very useful

  2. systemsboy
    Posted February 10, 2006 at 2:37 AM | Permalink

    Dude…

  3. Posted February 22, 2009 at 1:39 PM | Permalink

    proper!!!!!!!!

Post a Comment

Your email is never shared. Required fields are marked *

*
*