How to make your boring macOS terminal look so much better

A 5 minutes guide to customizing your macOS terminal to increase productivity and improve the interface

Yassine Rodani
4 min readOct 11, 2022
Photo by AltumCode on Unsplash
Photo by AltumCode on Unsplash

I do pretty much all of my software development work inside the terminal, so It’s important for me to have a pleasant terminal window to look at or work with.

In this article, I’ll be sharing exactly how I set up my mac terminal to look much cooler and get a much better experience. We’ll be using iTerm2, zsh, Oh-My-Zsh, Powerlevel10k as the macOS terminal theme, and some other cool plugins!

We’ll go from here:

Old macOS terminal
Old macOS terminal. Image by Author

To here:

New macOS terminal
New macOS terminal. Image by Author

Install Homebrew

The first thing we want to do is open up a new terminal window and then run the following command to install Homebrew which we'll be using as a package manager to download things for our machine.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After installing, add it to the path (replace “[username]” with your actual username):

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[username]/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

You can check whether homebrew is correctly installed by running:

brew --version
Printing brew version
Brew version. Image by Author

Install iTerm2

We’re going to use iTerm2 which I think is a lot better than the default macOS terminal. To install, run:

brew install --cask iterm2

Switch to iTerm2 for the remainder of this walkthrough.

Install Git

We want to make sure that we have Git installed. To check you can do:

git --version
Printing git version
Git version. Image by Author

I have it installed, but if you don’t you can run:

brew install git

Install Oh My Zsh

We’re now going to install Oh My Zsh to configure the terminal and make it look much nicer. Oh My Zsh works on top of zsh. It provides us with a configuration file ~/.zshrc and allows us to apply themes to make iTerm2 more attractive and usable.

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install PowerLevel10K theme for Oh My Zsh

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

Now that it’s installed, open the “~/.zshrc” file with your preferred editor and change the value of “ZSH_THEME” as shown below:

ZSH_THEME="powerlevel10k/powerlevel10k"

To reflect this change on your terminal, restart it or run this command:

source ~/.zshrc

Install Meslo Nerd font

Install the font by pressing “y” and then quit iTerm2.

Update VS Code terminal font (Optional)

I know a lot of you might be using VS Code so I wanted to point out that once you change the font in the terminal you’ll also have to change it in the settings for VS Code terminal by opening up the settings.json file and adding this line:

"terminal.integrated.fontFamily": "MesloLGS NF"
VS Code settings.json file. Image by Author

Configure PowerLevel10K

Restart iTerm2. You should now be seeing the PowerLevel10K configuration process. If you don’t, run the following:

p10k configure

Follow the instructions for the PowerLevel10K configuration to make your terminal look as desired.

Increase terminal font size

  1. Open iTerm2 preferences
  2. Go to Profiles > Text
  3. I personally increase my font size to about 16px
Increasing font size
Font size. Image by Author

Change iTerm2 colors to my custom theme

  • Open iTerm2
  • Download my color preset by running the following command (will be added to Downloads folder):
curl https://raw.githubusercontent.com/yassine-rd/mac-terminal-config/main/coolkheey.itermcolors --output ~/Downloads/coolkheey.itermcolors
  • Open iTerm2 preferences
  • Go to Profiles > Colors
  • Import the downloaded color preset (coolkheey)
  • Select the color preset (coolkheey)
Selecting coolkheey color preset
coolkheey color preset. Image by Author

You can find other themes here: Iterm2 Color Schemes

Install zsh plugins

I’ll be using four plugins, namely, git, syntax highlighting, suggestions, and web_search.

  • Install zsh-autosuggestions, a pluging that suggests commands as you type based on history and completions:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  • Install zsh-syntax-highlighting. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  • Open the “~/.zshrc” file in your desired editor and modify the plugins line to what you see below:
plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)
Custom plugins. Image by Author
  • Load these new plugins by running:
source ~/.zshrc

You’re Done!

With that, you’re finished and should have a much better looking macOS terminal! Hope you liked this article. Do share your ideas, thoughts and suggestions.

--

--

No responses yet