How to Jump Words Using Option Key Navigation in macOS Terminal

Engineers, developers, and system administrators switching to macOS from Linux or Windows environments often experience an immediate productivity obstacle in the default Terminal app: pressing Option + Left Arrow or Option + Right Arrow fails to jump the cursor forward or backward across words. Instead, macOS Terminal emits raw escape sequences (such as [D or [C) or outputs special typographic characters (such as ç or ∂) directly into the shell prompt.

Standard Unix shells (Zsh and Bash) rely on the readline library and standard terminal emulation escape codes to navigate text tokens. By configuring Terminal profile keyboard settings and enabling Meta key emulation, you can restore intuitive word jumping and token deletion across all CLI sessions.

Method 1: Enabling “Use Option as Meta Key”

The fastest and most comprehensive method to enable word navigation across Terminal, Vim, Emacs, and remote SSH sessions is activating Meta key emulation:

  1. Open Terminal on your Mac.
  2. Click Terminal in the top menu bar and select Settings… (or press Cmd + ,).
  3. Select the Profiles tab at the top.
  4. Select your active profile (e.g. Basic or Pro) from the left column.
  5. Click the Keyboard tab on the right side.
  6. Check the box labelled Use Option as Meta key.
  7. Close the Settings window.

Now, pressing Option + B moves backward one word, and Option + F moves forward one word, matching standard Emacs/POSIX terminal conventions.

Method 2: Mapping Option + Left/Right Arrow Keys to Escape Sequences

If you prefer jumping words using the arrow keys (Option + Left Arrow and Option + Right Arrow) rather than letter keys:

  1. In Terminal > Settings > Profiles > Keyboard, locate the list of key mappings.
  2. Scroll down to inspect existing arrow key actions.
  3. Double-click the entry for ⌥← (Option + Left Arrow). If it does not exist, click the + button at the bottom of the list to create it:
    • Key: Left Arrow
    • Modifier: Option
    • Action: Send Text (or Send Escape Sequence)
    • Text / Sequence: Enter \033b (or press Escape followed by b).
  4. Click OK.
  5. Next, configure ⌥→ (Option + Right Arrow):
    • Key: Right Arrow
    • Modifier: Option
    • Action: Send Text
    • Text / Sequence: Enter \033f (Escape followed by f).
  6. Click OK.

Configuring Option + Delete to Erase Previous Word

By default, pressing Option + Delete should erase the word immediately to the left of the cursor. If this shortcut outputs a tilde or fails:

  1. In the Keyboard mappings list, locate ⌥⌫ (Option + Delete).
  2. Set the action to Send Text.
  3. Enter \033\177 (or \027 for standard Unix backward kill word).
  4. Click OK.

Verifying Configuration in Zsh and Bash

On modern macOS (Sonoma, Sequoia), Zsh is the default interactive shell. Test your new keybindings directly in the prompt:

  1. Type a long command string:
    docker run -d --name web_gateway -p 8080:80 nginx:alpine
  2. Press Option + Left Arrow repeatedly. The cursor jumps cleanly across whitespace and delimiter boundaries.
  3. Press Option + Delete to erase individual arguments without holding backspace.

Configuring these terminal keyboard mappings eliminates tedious character-by-character navigation, bringing fluid command-line ergonomics to macOS.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.