Using Alt/Cmd + Right/Left Arrow in iTerm

  • Go to iTerm Preferences → Profiles
  • select your profile
  • then the Keys tab
  • Click Load Preset...
  • and choose Natural Text Editing


Go to iTerm Preferences → Profiles, select your profile, then the Keys tab. Find ⌥← and ⌥→ and set them to send escape sequence b and send escape sequence f respectively.

Mapping alt-right to move cursor forward by one word

If you use ⌘→ and ←⌘ you will need to remap the next and previous tab shortcuts which are set to those as default. Terminal uses ⇧⌘→ and ⇧⌘← for these.

You can do this under Profiles, or just globally under Keys (shown below) if you wish to set it globally. Note that settings in Profiles override global settings in Keys.

Globally mapping alt-right to move cursor forward by one word


If you use bash, you can also add

"\e\e[D": backward-word
"\e\e[C": forward-word

to ~/.inputrc.


  1. Go to: Preferences > Profiles > Keys

  2. Look for the actions of ⌥← and ⌥→. They would have been mapped to: Send Hex codes

  3. Change them to Send Escape sequence with Esc+B for backward and Esc+F for forward.


For zsh I inserted in ~/.zshrc

bindkey "\e\e[D" backward-word
bindkey "\e\e[C" forward-word

for bash I inserted in ~/.inputrc

"\e\e[D": backward-word
"\e\e[C": forward-word