Mac OS X Terminal: Keyboard word shortcut
If you use the Mac Terminal app and want to navigate word by word instead of by character, the default instinct would be to press option+left cursor or option+right cursor.
Unfortunately, pressing that would give a [D or [C.
To set up the keyboard shortcut correctly, we should first know that the Mac shortcut for word navigation is esc+f for going one word forward and esc+b for going one word backwards.
Open up the Terminal.app by going to Finder > Utilities (or Ctrl+U) > Terminal.app
In Terminal, go to Terminal → Preferences
Under Preferences, go to Settings tab and select the Keyboard tab on the right.
Change the option cursor left Key to \33f by double-clicking on it. Delete the [D characters by clicking on "Delete one character" button. Then, press f so your screen will look like this:
The same way, change the option cursor right Key to 33f.
If you've cleared the box by accident, you can get the 33 by pressing the esc key.
Make sure the checkbox with Use option as meta key is checked.
After making the changes, go back to the Terminal and try option+left cursor and you should be able to navigate word by word on the left.
Created on 07 September 2014