6 Useful Terminal Shortcuts for iTerm2
Tags: iterm2, terminal, shortcuts, productivity
Published: 2021-09-12 13:45:22

<small>Orginally published at Medium on Dec 16th 2020.</small>

Are you looking to become a better developer by creating an empowering digital workflow? iTerm2 will help you to make the most of your day behind the keyboard. It’s the terminal that has all the functionality a developer ever wished for.

The guide below will help you to:

<ol>
<li>Download and install iTerm2</li>
<li>Set up a hotkey shortcut — Double tab option ( ⌥)</li>
<li>View timestamps</li>
<li>Highlight and comment on logs</li>
<li>Autocomplete — Command (⌘) plus semicolon (;)</li>
<li>Click links from the terminal — Command (⌘) plus click</li>
<li>Focused troubleshooting</li>
</ol>

---

At first, it seems like the native terminal on a Macbook Air or Macbook Pro comes with all the functionality you need — that is, until you discover that there are much more powerful alternatives than the default Mac terminal.

As developers, we engage in a high number of repetitive tasks during a given day. A craftsman needs the right tools to build, and so do we. Any change that enables us to work a little smarter, a little more efficiently, will have a significant impact on our developer productivity. All the few seconds here and there end up to countless hours over and over again.

iTerm2’s tagline is “the features you didn’t know you’d love.” And that’s indeed a pretty accurate way to describe it. Your terminal, together with your IDE, is the backbone of writing applications and code. The goal is to make coding as enjoyable as possible by optimizing how you work, by having a smooth transition from one workflow to another.

Even the simplest of tools can empower people to do great things.

Below is an overview of a minimal setup for some of iTerm2's most-loved features. If, after reading this guide, you’d like to know more, check the official [iTerm2 documentation](https://iterm2.com/documentation.html) for other powerful ideas to boost your productivity.

## 1. Download and [Install iTerm2](https://iterm2.com/)

---

## 2. Set Up Hotkey Shortcut (Double-Tap ‘Option ( ⌥) ‘)

![Hotkey 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73ampfvfxro3t3elo1mo.gif)

The terminal window will pop up as the full width of your screen with a slightly transparent background. This makes it possible for you to read what’s behind the terminal, useful when you’re watching a video with setup instructions. By double-tapping the hotkey again, the terminal window minimizes and you go back to the editor or website you were working in.

Go to Preferences > Keys > Hotkey > Create a Dedicated Hotkey Window

![Hotkey 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0zb7x3th9j3ifs6r14p.png)

![Hotkey 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brqrrmkzsd9ieggy1c94.png)

Great, you are set up! Now close and restart your iTerm2 editor. By double-tapping the option key, the editor will appear from the top of your screen.

When the terminal window is opened, you can press the combination Command (or Cmd) ⌘ + Enter to make the window full-screen size.

---

## 3. View Timestamps

Go back in time and find earlier logs and comments. On the right screen of your terminal window, you can easily retrace back your steps in time.
![timestamp1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hh554d3580e3utohpj1o.png)
![Timestamps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/keyu8sn6zo7ucy1xckum.png)

---

## 4. Highlight and Comment on Logs

Troubleshooting log files can be complex and hard. The lines of code to read in a log can be overwhelming. Help yourself and your teammates by highlighting and commenting on sections to resolve your bugs more quickly.

![Highlight1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unobsefpawpg4iiyxjok.png)
![Highlight2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2my539zel0qlfhs6wuqz.png)

---

## 5. Autocomplete — Command (⌘) Plus Semicolon (;)

Press the Command key (⌘) and semicolon (;) at the same time to autocomplete terminal actions performed earlier.

![Autocomplete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ioal9s8bl1mcng9ongj.png)

---

## 6. Click Links From the Terminal — Command (⌘) Plus Click

No need to copy a link, manually open the browser, and paste the link. You can easily click any link or file within your terminal and be redirected automatically.

![Click link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m73rkph67eowvnznhik4.gif)

---

## 7. Focused Troubleshooting

If you are overwhelmed by the number of logs, you can isolate part of the code. Inspect part of the terminal output by selecting the code followed by Command (⌘) plus Option ( ⌥) plus Z. The selected code is now visible in a new tab window. Press Escape to exit and return to the main editor window.

![Logs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5tsza2ig9n0q85qu2no6.gif)