rafaelmaeuer
5/12/2017 - 3:55 PM

Use ⌥ ← and ⌥→ to jump forwards / backwards words in iTerm 2, on OS X - From https://coderwall.com/p/h6yfda/use-and-to-jump-forwards-backwar

Use ⌥ ← and ⌥→ to jump forwards / backwards words in iTerm 2, on OS X - From https://coderwall.com/p/h6yfda/use-and-to-jump-forwards-backwards-words-in-iterm-2-on-os-x

By default in iTerm 2, it's a pain to skip between words.

Here's how you can configure iTerm 2 on OSX to allow you to use ⌥ ← and ⌥→ to do just that.

First you need to set your left ⌥ key to act as an escape character.

Second you need to either locate the current shortcut for ⌥ ← or create a new one, in the Profile Shortcut Keys, with the following settings:

  • Keyboard Shortcut: ⌥←
  • Action: Send Escape Sequence
  • Esc+: b

Third, repeat for the ⌥→ keyboard shortcut with the following settings:

  • Keyboard Shortcut: ⌥→
  • Action: Send Escape Sequence
  • Esc+: f

You're done! Now you can skip entire words on the command line by holding down the left ⌥ key and hitting ← or →

To make this work for the right option key you need to set the key modifier to act as an Escape Sequence, a la the first step.