I recently decided to give iTerm another try after one of my friends recommended it to me. I had tried it several times before, and never quite gotten used to it. I always seemed to prefer Visor + Terminal for some reason or other, but since I’ve setup a global keyboard shortcut to focus / open iTerm, I’ve been enjoying having a tabbed terminal.
One of the things that was fairly easy to setup in Terminal that took me several days to figure out in iTerm was how to navigate Forward and Backword across whole words using the keyboard. ( This article on the Textmate blog explains how to set this up in the regular terminal. )
I tried doing all sorts of things to setup something similar in iTerm, like using a .inputrc file, until I finally figured out how to do it.
Open iterm.
Go to Bookmarks > Manage Profiles
Choose Keyboard Profiles on the left and edit the Global Profile
Map Alt + Left Arrow to Backword / Previous Word
Next to Mapping, click the + sign.
For Key, choose cursor left.
For Modifier, check the Option Box
For Action, choose send escape sequence
Write b in the input field.
I also checked High interception priority for good measure.
Map Alt + Right Arrow to Forward / Next Word
Next to Mapping, click the + sign.
For Key, choose cursor right.
For Modifier, check the Option Box
For Action, choose send escape sequence
Write f in the input field.
I also checked High interception priority here for good measure.
Now you have some sweet keyboard navigation action.
Bonus:
Beginning of Line: Ctrl + a
End of Line: Ctrl + e