Terminal Setup - Make your Mac terminal awesome
Tags: terminal, ohmyzsh, bash, dev
Published: 2022-01-07 16:48:50

 ---
title: Terminal Setup - Make your Mac terminal awesome
published: true
description: How to configure your Mac terminal as Developer
tags: terminal, ohmyzsh, bash, dev
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q81bdk4ur4sfuij7ax45.png
---

I recently installed my new MacBook and set up my terminal. Here I'll show you how to do the same for your MacBook. 

## The final result
This is the end result based on the delicious **powerlevel10k**. Easy to configure and modify. Optimized to work as a developer. 
> You will notice the toolbar at the top (Cpu, Ram, Network) to always have an overview of the hardware consumption.

![Mac terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/soupov6aejxnjadtwzli.png)
 

### Prerequisites
Install [Homebrew](https://brew.sh/index_fr)
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
Install [iTerm2](https://iterm2.com/) and git
```bash
brew install --cask iterm2
brew install git
```

Install [Oh My Zsh](https://ohmyz.sh/#install)
```bash
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```

### Theme installation
I choosed [powerlevel10k](https://github.com/romkatv/powerlevel10k) probably one of the best and most flexible theme you can choose.
You can easily change your terminal layout simply by rerun the installation command.


Start to install [MesloLGS Fonts](https://github.com/romkatv/powerlevel10k#fonts)
```
MesloLGS NF Regular.ttf
MesloLGS NF Bold.ttf
MesloLGS NF Italic.ttf
MesloLGS NF Bold Italic.ttf
```


Then install **powerlevel10k** itself
```
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
```

In `~/.zshrc` set the ZSH theme to use:
```
ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
```

You will probably at least configure these two ZSH plugins:

**zsh-syntax-highlighting** - Fish shell like syntax highlighting for Zsh. This is what makes my aliases/commands green above. If it's green then it's installed!
**zsh-autosuggestions** - Fish-like autosuggestions for zsh. Will show a preview of the last matching command while typing. Press right to use

In `~/.zshrc` set the ZSH plugins to use:
```bash
plugins=(
  git
  zsh-syntax-highlighting
  zsh-autosuggestions
)
```

**Restart your terminal** with Zsh

Now you can run 
```bash
p10k configure
```

If you have issue with fonts, check MesloLGS font is selected.
`Open iTerm2 → Preferences → Profiles → Text and set Font to MesloLGS NF`.

Finally, if you want to include your existing bash aliases and functions:
In `~/.zshrc` source your bash_profile just before the **export ZSH**
```bash
source ~/.bash_profile
```

### Add the Toolbar
![Toolbar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfk2ihzdvd4hx6oas6mo.png)

Open your `iterm2 > Profile > Session > Status bar enabled`
![iterm2 conf](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thnc8dsbdooisi2kr0m0.png)

Select your widgets
![iterm2 status bar widgets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwxz05tbpydattvh1uhs.png)
 
## Finished!
I hope this small tutorial will help you to improve your setup. It is obviously not complete but easy enough to move on.