Terminal is one of my most used apps throughout the day. I wanted to customize it so that it would best fit into my workflow and decrease the amount of time that I had to spend on the command line. This is a quick setup guide on how I did that.

This is the first window I see when I open my terminal:

Terminal home

And when I’m working on a project:

Terminal showing details about the project

iTerm 2

Coming from Hyper.js, I recently made the switch to the more robust iTerm and couldn’t be happier. iTerm’s configurability makes it a really easy to fine-tune your workflow and offers a lot more functionality than Hyper. Also, being a native app rather than an Electron app, the speed differences are much more noticeable.

Dracula Theme

I use the theme Dracula, which is a colorful but not overwhelming theme. It makes it easy for me to differentiate some of the different things I’m reading when using it, and its wide availability for many different applications keep a consistent theme for the different apps on my computer.

Fonts

Because of my shell prompt having the git icons, the font must support programming ligatures, which are typically referred to as “powerline” fonts. I typically switch between SF Mono Powerline and Fira Code. Both of them are clean and easy to read and fit in well with my terminal.

Status Bar

iTerm has this really neat feature called the status bar. It’s a floating information bar above your terminal which keeps always displays some information. Its unobtrusive, and the color scheme makes the terminal even more beautiful.

How to enable the status bar

Status bar settings

My final status bar

Natural Text Editing

Out of the box, iTerm can be a little more restrictive in how you’re able to interact with text in the prompt. However, a quick change in the profile section of the settings allows you to interact with the command prompt as naturally as you would with any other application on your computer, using your standard jump-to short cuts. All you have to do is enable the natural text editing preset.

Enable natural text editing

Zsh Shell

The first thing I did when setting up my terminal was to install the Zsh shell. As of macOS Catalina, zsh is now the default shell.

This is my favorite shell to use, and I pair it with the Oh My Zsh framework to manage zsh. One of my favorite things about Oh My Zsh is the shortcuts for the commands I run every day. For example, instead of git commit -m you can run gcmsg. There’s a full list of these shortcuts in this cheatsheet. I greatly appreciate these shortcuts, especially considering that I use them hundreds of times a day, which saves me a lot of typing.

Zsh Theme + Plugins

Spaceship

My Zsh prompt of choice is Spaceship, which I find to be a lot cleaner and nicer to use than the popular Agnoster theme. Agnoster uses large blocks of color on the screen, which looks less refined than the text-based prompt that Spaceship uses.

Syntax Highlighting

One of the first plugins I installed was zsh-syntax-highlighting, which adds syntax highlighting while typing out your command. This way, its quick to tell if a certain command is available, or if you’ve made a typo.

Autosuggestions

zsh-autosuggestions is a plugin which will use previously used commands to predict the next command. Of course, this is non-intrusive, and you have to press the right arrow if you want to fill in what was predicted. It’s a nice plugin to have when you’re repeating a lot of the same commands over again to test something and you don’t want to type out the entire thing.

I use the ‘->’ key to fill the autocomplete without execution, and Control+Space for fill and execution. You can change the setting using bindkey in terminal, like so:

bindkey '^ ' autosuggest-execute

Aliasing

One of the most useful things that I use in my terminal is the ability to alias commands, so that I can type much shorter commands. They’ve made my life a lot easier for a couple of reasons.

The first is being able to jump from project to project in a single command, by aliasing a cd command to the absolute path. For example, for any of my classes, I alias 440 for my CS 440 class, or ymca for my Hack4Impact project to go directly into that directory. That way, no matter where I am, I will go straight to that directory.

Another thing that I use a lot is o for open . to open in Finder, and c for code . to open in VSCode. These are small things that make my development process a lot faster when switching between projects.