In this article I want share the keyboard shortcuts that I use on a daily basis, in various environments.
Advantages of using shortcuts:
- Shave off a few seconds or milliseconds, hundreds of times over. The time savings really add up.
- Make you look smarter in screen sharing sessions, live demos and pairing.
- They're just fun to use!

Shortcut | Action |
---|
⌘ + ⇧ + ⌥ + ( ↑ / ↓ ) | Rectangular selection |
⇧ + ⌥ + 🖱️ Drag | Rectangular selection (mouse) |
⌘ + A | Select all |
⌘ + L | Select line |
⌃ + ( A / E ) | Skip to line start / end |
⌥ + ( ← / → ) | Skip by word left / right |
⌥ + ⇧ + ( ← / → ) | Select by word left / right |
⌥ + ( ↑ / ↓ ) | Move line up / down |
⌥ + ⇧ + ( ↑ / ↓ ) | Duplicate line up / down |
⌘ + ⇧ + ( [ / ] ) | Switch tab left / right |
( ⌃ + ⇤ ) / ( ⌃ + ⇧ + ⇤ ) | Switch tab most / least recent |
⌘ + ( [ / ] ) | Indent / outdent |
⌘ + / | Toggle comment |
⌘ + W | Close current tab |
⌘ + K, W | Close all tabs. Keep window open. |
⌘ + ⇧ + W | Close current window |
⌘ + P | Quick find file |
⌘ + ⇧ + P | Quick find action |
⌘ + T | Quick find symbol |
⌘ + N | Open new tab |
⌘ + ⇧ + N | Open new window |
⌘ + ⇧ + E | Focus on file browser |
⌘ + F2 | Select all instances of current word |

Shortcut | Action |
---|
⌃ + ⌘ + ( ↑ / ↓ ) | Rectangular selection |
⌥ + 🖱️ Drag | Rectangular selection (mouse) |
⌘ + A | Select all |
⌘ + L | Select line |
⌃ + ( A / E ) | Skip to line start / end |
⌥ + ( ← / → ) | Skip by word left / right |
⌥ + ⇧ + ( ← / → ) | Select by word left / right |
⌥ + ( ↑ / ↓ ) | Move line up / down |
⌘ + ⇧ + D | Duplicate line down |
⌘ + ⇧ + ( [ / ] ) | Switch tab left / right |
( ⌃ + ⇤ ) / ( ⇧ + ⇤ ) | Switch tab most / least recent |
⌘ + ( [ / ] ) | Indent / outdent |
⌘ + / | Toggle comment |
⌘ + W | Close current tab |
⌘ + P | Quick find file |
⌘ + ⇧ + P | Quick find action |
⌘ + ⇧ + W | Close current window |
⌘ + N | Open new tab |
⌘ + ⇧ + N | Open new window |
⌃ + ⇧ + G | Select all instances of current word |

Shortcut | Action |
---|
( ↑ / ↓ ) | Previous / Next history |
⌃ + R | Search history |
⌃ + C | Stop current process |
⌃ + ( A / E ) | Skip to line start / end |
⌃ + W | Delete previous word |
⌃ + D | Delete next character |
⌘ + T | Open new tab |
⌘ + N | Open new window |
Some additional convenience shortcuts can be added by configuring iTerm2 key mappings, as described in Marius Schulz's excellent article.
Shortcut | Action |
---|
⌥ + ( ← / → ) | Skip by word left / right |
⌘ + ( ← / → ) | Skip to line start / end |
⌥ + ⌫ | Delete previous word |
⌘ + ⌫ | Delete line |

Shortcut | Action |
---|
⌘ + B | Bold |
⌘ + I | Italic |
⌘ + ⇧ + X | Strikethrough |
⌘ + V | Make the selection a link with pasted URL from clipboard |
⌘ + U | Upload file with file picker |
>, Space | Start a blockquote |
⌘ + ⇧ + C | Toggle inline code block |
>, Space | Start a blockquote |
``` | Start full line code block |

Shortcut | Action |
---|
⌘ + C | Copy full file name of the selected file. Including path. |
⌘ + ⇧ + O | Open the selected file. Uses the default editor. |
⌘ + ⇧ + C | Focus on the commit message input. |
↓ | On message input, show recent commit messages. Click to re-use. |
⌘ + ⇧ + ( [ / ] ) | Switch tab left / right |
⌘ + T | Open new tab |
⌘ + N | Open new window |