Skip to content

Instantly share code, notes, and snippets.

@rannn505
Created January 26, 2022 23:34
Show Gist options
  • Save rannn505/0496cf92e65c69c12a8e38181dd98e6d to your computer and use it in GitHub Desktop.
Save rannn505/0496cf92e65c69c12a8e38181dd98e6d to your computer and use it in GitHub Desktop.
Common keyboard shortcuts for iTerm2
{
"Key Mappings": {
"0xf702-0x300000-0x7b": {
"Label": "Cursor Start ⌘←",
"Action": 11,
"Text": "0x01"
},
"0xf703-0x300000-0x7c": {
"Label": "Cursor End ⌘→",
"Action": 11,
"Text": "0x05"
},
"0xf702-0x280000-0x7b": {
"Label": "Cursor Word Left ⌥←",
"Action": 11,
"Text": "0x1b 0x62"
},
"0xf703-0x280000-0x7c": {
"Label": "Cursor Word Right ⌥→",
"Action": 11,
"Text": "0x1b 0x66"
},
"0xf702-0x220000-0x7b": {
"Label": "Select Word Left ⇧←",
"Action": 45,
"Text": "0"
},
"0xf703-0x220000-0x7c": {
"Label": "Select Word Right ⇧→",
"Action": 46,
"Text": "0"
},
"0x7f-0x100000-0x33": {
"Label": "Delete All ⌘⌫",
"Action": 11,
"Text": "0x15"
},
"0x7f-0x80000-0x33": {
"Label": "Delete Word Left ⌥⌫",
"Action": 11,
"Text": "0x01b 0x08"
},
"0x7a-0x100000-0x6": {
"Label": "Undo ⌘Z",
"Action": 11,
"Text": "0x1f"
},
"0x5a-0x120000-0x6": {
"Label": "Redo ⌘⇧Z",
"Action": 11,
"Text": "0x18 0x1f"
}
}
}
@therealklanni
Copy link

therealklanni commented Mar 10, 2025

@xiuyongwu

I'm just wondering why is that.

Because vi has its own keybindings

@rannn505
Copy link
Author

rannn505 commented Mar 23, 2025

@xiuyongwu, as @therealklanni correctly pointed out, vi has its own keybindings separate from iTerm, which is why the ⌘ + ➡️ shortcut behaves differently inside vi. The good news is that vi's keybindings are easy to customize to your preference. You can learn more here: Mapping Keys in Vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment