How can I move through words when typing a command in iTerm2?
I finally found the solution to this problem here: https://coderwall.com/p/h6yfda. The necessary steps are shown below:
- Go to Preferences, Profile, Keys.
- Set your left ⌥ key to act as an escape character.
- Locate the current shortcut for ⌥ ← or create a new one, with the following settings:
- Keyboard Shortcut: ⌥←
- Action: Send Escape Sequence
- Esc+: b
- repeat for the ⌥→ keyboard shortcut with the following settings:
- Keyboard Shortcut: ⌥→
- Action: Send Escape Sequence
- Esc+: f
The default is on Control-left Control-right. To customize, edit preferences/Keys and associate the escape code to some other hotkey of your choice
Open your profile and under Keys tab, use Natural Text Editing option.