How to set keyboard shortcuts to jump to beginning/end of line? [closed]

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
14

To jump between words and start/end of lines in iTerm2 pick one of the two solutions below.

1. Simple solution (recommended)

  1. Open Preferences
  2. Click “Profile” tab
  3. Select a profile in the list on the left (eg “Default”)
  4. Click “Keys” tab
  5. Click “Key Mappings” tab (if it exists)
  6. Click the “Presets” dropdown and select “Natural Text Editing”

enter image description here

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:

  1. Click “Keys” tab
  2. 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:

  1. Open Preferences
  2. Click “Profile” tab
  3. Select a profile in the list on the left (eg “Default”)
  4. Click “Keys” tab
  5. Click “Key Mappings” tab (if it exists)
  6. Click the [+] icon
  7. 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.

Leave a Comment