DEV Community

Hunter Chang
Hunter Chang

Posted on • Edited on

iTerm2 Shortcut Keys

iTerm2 is one of the most popular terminals out there for developers and programmers. Great as it is, the default shortcut keys can be somewhat lacking. You can add your own shortcut keys under your Profile to make iTerm2 do some amazing things.

First, go to iTerm2 > Preferences > Profiles > Keys

Here you can see the current Key Mappings. Click on the "+" button to add a shortcut combination. You'll need to enter the correct Hex Code for some of the Actions. Here is a visual:

Here are the keys I've mapped for myself:

Skipping to Beginning and End of Line:


// Skip to Beginning of Line
command + left-arrow
Send Hex Code
0x01
Enter fullscreen mode Exit fullscreen mode
// Skip to End of Line
command + right-arrow
Send Hex Code
0x05
Enter fullscreen mode Exit fullscreen mode

Skipping to Left and Right of a Word:


// Skip Left of Word
option + left-arrow
Send Escape Sequence
b
Enter fullscreen mode Exit fullscreen mode
// Skip Right of Word
option + right-arrow
Send Escape Sequence
f
Enter fullscreen mode Exit fullscreen mode

Delete Single Word:


// Delete Single Word
option + delete (The shortcut combo will look like ⌥←Delete)
Send Hex Code
0x17
Enter fullscreen mode Exit fullscreen mode

Delete Entire Line:


// Delete Entire Line
command + delete (The shortcut combo will look like ⌘←Delete)
Send Hex Code
0x15
Enter fullscreen mode Exit fullscreen mode

Hopefully you find these shortcut keys useful! For more tips and tricks on web development, check out my blog at https://codebushi.com

Top comments (2)

Collapse
 
neotohin profile image
Amzad Hossain

Build 3.4.3 : Not working for me on Big Sur.

Collapse
 
gkirito profile image
Gkirito

Thank you for sharing this shortcut keys, it's very helpful to me