Terminal++ with iTerm2 & ohmyzsh
Tags: devops, linux, tutorial, beginners
Published: 2020-04-04 20:01:27

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/28ccjze5k7wgl3kn0m3t.png
title: Terminal++ with iTerm2 & ohmyzsh
published: true
description: Upgrade your terminal experience.
tags: DevOps, linux, tutorial, beginners
---
One thing I love about getting a new dev machine is starting off fresh. After getting my new MacBook Pro one of the first things I look forward to is setting up my dev environment. For me this starts with my shell & terminal setup. 

## Table of Contents
* [PreReqs](#PreReqs)
+ [iTerm2] (#iTerm2)
+ [OH MY ZSH!] (#ohmyzsh) 
+ [What's your Theme?] (#Your Theme)
 + [Choose a Theme] (#Choose a Theme)
 + [Install your Theme] (#Install your Theme)
+ [Time to Power Up!] (#Time to Power Up)
 + [Powerlevel10K] (#Powerlevel10K)
+ [The Wrap Up](#The Wrap Up)
   

## PreReqs? <a name="PreReqs"></a>
If you don't have Homebrew installed you will want to do that first as the rest of this post assumes so. Homebrew pauses and explains what its doing so expect interaction on your part as well. 

Copy & Paste the snippet below.
```linux
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
``` 
  

## Upgrade your Terminal - iTerm2 <a name="iTerm2"></a>
By this I mean if you're still only using the basic terminal that comes with your Macbook its  time to consider making the switch to iTerm2. Before you ask why just take a visit to the features page on the website. 

Download and Install using this link: [https://www.iterm2.com/downloads.html](https://www.iterm2.com/downloads.html)

OR

Use cask from brew to install.
```linux
brew cask install iterm2
```
  
## OH MY ZSH! <a name="ohmyzsh"></a>
![oh my zsh](https://ohmyz.sh/img/OMZLogo_BnW.png)
To complete the base package this gem should be in your toolkit. Firstly make sure that you already are using a zsh shell. For new macs this should already be your default. If you're upgrading to Catalina or have an older OS you may need to switch your shell. In your new downloaded iTerm2 shell simply confirm with an echo command.
```linux
echo $SHELL
/bin/zsh
```
You are good to go as long as "/bin/zsh" was returned. If another shell was returned you  either need to change your default shell 
```linux
chsh -s /bin/zsh
```
or install zsh before proceeding.
```linux
brew install zsh
```
Now its time to proceed with what we are really here for; **oh-my-zsh.** If iterm is like getting the combo meal. Then **oh-my-zsh** is like ordering from the secret menu. You can take a look at their page ([https://ohmyz.sh/](https://ohmyz.sh/)) and/or just google to see what the fuss is all about.

Install **oh-my-zsh:**
```linux
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
You should notice the change to your shell now but if not just restart iterm2. Now you got your tools and it's time for the fun part. Customization!

**Note: The Rest of the article follows my personal setup. Follow along if you are interested in a similar configuration or tips on how to customize your own setup.**

## What's your Theme? <a name="Your Theme"></a>

### *Choose a Theme* <a name="Choose a Theme"></a>

Let's start off by choosing a theme. Themes can be found at [https://iterm2colorschemes.com/](https://iterm2colorschemes.com/). To install simply navigate by going to:

 iTerm2 → Preferences → Profiles → Colors → Color Presets → Visit Online Gallery. 

This will take you to the same page mentioned above. Near the top of the page you will see some folders named "tar.gz" and ".zip". By clicking on either of the folders you are able to download the entire bundle of themes on the page.  Of course if you are already on that page you can skip all of that navigation as well.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i5twm271v3n0jjk389r6.png)

### *Install your Theme* <a name="Install your Theme"></a>

iTerm2 → Preferences → Profiles → Colors → Color Presets → Import → <folder>→schemes → <choose your desired theme>

After this when you go back to Color Presets you will now see the theme you want as an option to be selected. 

## Time to Power Up! <a name="Time to Power Up"></a>

oh-my-zsh has its own set of themes that can give a boost to the look and feel of your terminal. The default along with many others can be found on the git documentation page but there are more out there if you are willing to search.

GitHub Documentation:

[https://github.com/ohmyzsh/ohmyzsh/wiki/Themes](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes)

### Powerlevel10K <a name="Powerlevel10K"></a>

My theme of choice is powerlevel10k. To install clone the repo
```linux
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
```
Next in your ~/.zshrc set the theme
```zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
```
Save and source
```linux
source ~/.zshrc
```
Upon success powerlevel10k will run a wizard for some setup configuration and will ask to install the Meslo Nerd Font; which is the recommended font for this theme.
![Example Terminal](https://dev-to-uploads.s3.amazonaws.com/i/rv9u6fmnm8g618mzu5cs.png)
<figcaption> Example Screenshot of How my Terminal Setup looks</figcaption>

## The Wrap Up <a name="The Wrap Up"></a>

Pretty much everything you need for an awesome terminal is now at your disposal. Of course there are far more customizations that can be done to tweak your setup and this will set you well on your way. Please share any comments or questions. I also plan on sharing more similar to this and possibly making a series for these kind of post. Let me know if there is something  in particular that piques your interest.