DEV Community

Hunter Chang
Hunter Chang

Posted on • Edited on

4 1

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

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay