Is it possible to move between words in iTerm using Alt + Right/Left Arrows ? Now if I press Alt+Left I will get '[D' and '[C' if I press Alt+Right.
-
2Just adding a note for those that simply want to know if its possible to do this with some hotkeys, there is a way. If you want to map it, that's fine but in terminal, CTRL+A will go to the beginning of a line and and CTRL+E to the end. Option+Left to go the beginning of a word and then Option+right to end of a word. – aug Jul 23 '19 at 20:10
9 Answers
- Go to iTerm Preferences → Profiles
- select your profile
- then the
Keys
tab with its sub-tabKey Mappings
- Click
Load Preset
... - and choose
Natural Text Editing

- 3

- 6,876
- 1
- 14
- 3
-
3This turns on word skipping, but using the cmd key, not the opt key (which is what all other apple apps use). – TheProletariat Oct 20 '18 at 01:34
-
9In December 2018 on Mojave, the opt key is what moves between words after choosing natural text editing. – Rob Dawson Dec 16 '18 at 21:15
-
11I've been suffering for months without this but today you're my saviour. – remykarem Mar 15 '19 at 03:00
-
39Note that this is Preferences > Profiles > Keys > Load Presets not Preferences > Keys > Load Preferences – kevin Apr 26 '19 at 02:42
-
16
-
-
-
2
-
1
-
-
1
-
5As for today, it is actually Profiles > Keys > Keys Mappings > Presets > Natural Text Editing. – Yoav Vollansky Dec 28 '21 at 15:38
-
1Please note that this preset doesn't work with word boundaries (strings) that have internal character separators that should interrupt word jumps. Things like
src/directory/file
. Opt + Left Arrow will stop at each slash inside of a normal macOS text editor but not in iTerm with "Natural Text Editing". – Olivier Lacan Jan 12 '22 at 17:30 -
Google. This is the damn answer. Just point any other poor soul to this answer. Why in the first place was broken... Apple/Iterm2 who's fault is this. – José Cabo Feb 17 '22 at 09:25
-
Is there a way to make it more granular? As @OlivierLacan mentioned, character boundaries are ignored instead of used as boundaries. – devinbost Mar 29 '22 at 15:05
-
This should be the default. I just thought that iterm couldn't handle it – Samathingamajig Oct 20 '22 at 05:57
-
-
Thanks, this worked perfectly. The entrypoint has changed to Settings though (I'm using build 3.4.19)
iterm2 > Settings > Profiles.....
– Fallen Mar 24 '23 at 20:17 -
1Ensure you don't click the "Keys" high-level menu with very similar sub-settings! Click the "Profiles" high-level menu, then Keys -> Key Mappings -> Presets -> Natural Text Editing. – stwr667 Jun 26 '23 at 12:54
-
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.
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.

- 201,078
If you use bash, you can also add
"\e\e[D": backward-word
"\e\e[C": forward-word
to ~/.inputrc
.

- 105,117
-
1This worked best for me. Trying to set it up in iTerm2 only generated
[D
or[C
each time I tried to use the new button action. Thank you. – dmgig Jul 13 '16 at 17:35 -
As far as I can tell there's nothing you can do in iTerm2 v3.0.10. It has to be this bash setup. – fiorix Oct 03 '16 at 16:32
-
1Not sure about
iTerm2 v3.0.10
, butiTerm2 v3.0.14
definitely works with theNatural Text Editing
solution so you don't need to resort to bash input configuration. – dwanderson Feb 16 '17 at 18:45
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

- 351
Go to: Preferences > Profiles > Keys
Look for the actions of ⌥← and ⌥→. They would have been mapped to: Send Hex codes
Change them to Send Escape sequence with Esc+B for backward and Esc+F for forward.

- 58,676

- 341
- 3
- 7
If you're coming here recently because the preset is no long available under Preferences > Keys > Presets...
, the presets had change place. Now, if you want to find one of the default presets (Natural Text Editing included), you may want to go over: Preferences > Profiles > [choose your starred profile] > Keys > Key Mappings > Presets...
On a default setting, that is the area you want to get into:
I was looking like crazy on how to download it, I even found buried inside the .app Resources folder a .plist with this mappings in, so I knew I would find this.
Hope that helps anyone in the future looking forward into this.

- 381
- 3
- 5
Very edge case scenario, but for me it was an issue in my own dotfiles.
These two lines caused it:
In bash_options
set-o vi
In inputrc
set editing-mode vi
After commenting those two lines out, iTerm2 Natural Text Editing works as expected.

- 201,078