On a default iTerm2 install, word navigation doesn’t behave like macOS for me.
⌥← and ⌥→ don’t reliably jump by word, especially with zsh autosuggestions.
The fix is built in. No hex codes. No shell config.
Follow these steps:
- Open iTerm2 → Preferences
- Go to Profiles → (your profile) → Keys
- Under Key Mappings, open Presets
- Select Natural Text Editing
That’s it.
After this:
- ⌥← and ⌥→ move by word
- ⌥⌫ deletes one word
- ⌘← and ⌘→ go to line start/end
- Works with zsh autosuggestions
Nothing else needed.