I can see that Ctrl+left/right jumps to the beginning/end of line. How to change this to Cmd+left/right arrow?
14 s
To jump between words and start/end of lines in iTerm2 pick one of the two solutions below.
1. Simple solution (recommended)
- Open Preferences
- Click “Profile” tab
- Select a profile in the list on the left (eg “Default”)
- Click “Keys” tab
- Click “Key Mappings” tab (if it exists)
- Click the “Presets” dropdown and select “Natural Text Editing”
Note: if you have several profiles (f.e. Default and Hotkey Window) and want the same modification to be applied for all profiles, use these steps instead:
- Click “Keys” tab
- Choose “Key Bindings”
2. Mapping keys manually (Advanced)
If you don’t want to use the “Natural Text Editing” preset mentioned above, you can map the keys you need manually:
- Open Preferences
- Click “Profile” tab
- Select a profile in the list on the left (eg “Default”)
- Click “Keys” tab
- Click “Key Mappings” tab (if it exists)
- Click the
[+]
icon - Add the shortcuts from the table below
SHORTCUT | DESCRIPTION | ACTION | SEND |
---|---|---|---|
⌘ ← | Jump to beginning of line | “SEND HEX CODE” | 0x01 |
⌘ → | Jump to end of line | “SEND HEX CODE” | 0x05 |
⌘ ← Delete | Delete line | “SEND HEX CODE” | 0x15 |
⌥ ← | Jump to beginning of word | “SEND HEX CODE” | 0x1b 0x62 |
⌥ → | Jump to beginning end of word | “SEND HEX CODE” | 0x1b 0x66 |
⌥ ← DELETE | Delete word | “SEND HEX CODE” | 0x1b 0x08 |
⌘ z | Undo | “SEND HEX CODE” | 0x1f |
Note
If keyboard bindings already exists for the shortcuts above, they must be removed for the new ones to take effect.