Skip to content

Instantly share code, notes, and snippets.

@jpwilliams
Created February 10, 2020 09:43
Show Gist options
  • Save jpwilliams/1f9f38c10011889e446f6a4fbca1b796 to your computer and use it in GitHub Desktop.
Save jpwilliams/1f9f38c10011889e446f6a4fbca1b796 to your computer and use it in GitHub Desktop.
Using CMD/OPT+Arrow keys in iTerm
  • ⌘→ Move to end of line.
  • ⌘← Move to beginning of line
  • ⌥→ Move to beginning of next word
  • ⌥← Move to beginning of previous word

This is normal for Mac text processing, but not default in Terminal or iTerm2.

I haven't looked at how to enable this for Terminal, but for iTerm2:

  1. Open iTerm Preferences (⌘,)
  2. Go to the "Keys" tab
  3. Add the following entries:
    • ⌘→ Send Hex Code: 0x05
    • ⌘← Send Hex Code: 0x01
    • ⌥→ Send Escape Sequence: f
    • ⌥← Send Escape Sequence: b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment