After transitioning from Terminal to iTerm 2, you may notice commands like ⌥ + ← (moves left one word) and ⌘ + ← (moves to the beginning of the line) no longer work.

It is very simple process to add the keyboard shortcuts to your profile. Here are the keyboard shortcuts we are adding:

Keyboard Shortcut Description
⌥ + ← Move one word to the left
⌥ + → Move one word to the right
⌘ + ← Move to the beginning of the line
⌘ + → Move to the end of the line

#1. Open Preferences

Choose Preferences from the iTerm 2 menu (called Settings in newer versions).

#2. Click on Profiles

Find the Keys header and click on the + sign to add a new shortcut key.

#3. Add Keyboard shortcuts

Enter each of the following shortcuts below:

Keyboard Shortcut Action Value
⌥ + ← Send Escape Sequence b
⌥ + → Send Escape Sequence f
⌘ + ← Send Hex Code 0x01
⌘ + → Send Hex Code 0x05

These bindings use the shell’s Emacs-style line editing. iTerm2’s key-mapping documentation explains the escape-sequence and hex-code actions.

Congratulations, you can now move around in iTerm 2 just like Terminal!