iTerm 2 Shortcuts

Johan Attali bio photo By Johan Attali

iTerm 2 is a pretty awesome OSX terminal. It is highly customizable, supports themes (including solarized) and has powerful features.

But by default there are a few things that it doesn't do for you espcially in terms of per word browsing/deletion.

Everyione who used a text editor on OS X now how to navigate easly through words. Roughly:

  • Deletes the previous word
  • Deletes the next word
  • Moves to next word
  • Moves to previous word

Now there are similar shortcuts in bash but some of them use the aka: ctrl

  • w Deletes the previous word
  • d Deletes the next word
  • f Moves to next (forward) word
  • b Moves to previous (backward) word

Wouldn't be neat to have the exact same shortuts as in OSX ? It's very easy with iTerm2.

Open up the Preferences -> Keys Tab and map the following keys as follow:

  • ⌥←Delete: Send Hex Code: 0x1B 0x08
  • ⌥→Del: Send escape code d
  • ⌥→: Send escape sequence f
  • ⌥←: Send escape sequence b

This should look similar to this: