> For the complete documentation index, see [llms.txt](https://gejing.gitbook.io/101-building-modern-distributed-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gejing.gitbook.io/101-building-modern-distributed-platform/101-dev-environment-setup-on-mac/iterm2-in-10-min.md).

# iTerm2 Env Setup on Mac in 10 Minutes

On macOS Big Sur, using iTerm2, oh-my-zsh, nerd-fonts, powerlevel10k, iTerm2-Color-Schemes, and plenty plugins like autojump zsh-autosuggestions zsh-syntax-highlighting

{% hint style="info" %}
GitHub repo: <https://github.com/JingGe/101>
{% endhint %}

If you like the following iTerm2 style, you are at the right place. I will show you how to get this setup in 10 min.

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxpNNv-4S3f8quXWClk%2F-Mje_pefvJY0BF0jW6iA%2F-MjeazW4hpNWd6vp3gPU%2Fimage.png?alt=media\&token=5d6078ae-5909-47f6-b97d-cfd3a6a098dd)

## Install ohmyzsh

{% hint style="info" %}
sh -c "$(curl -fsSL <https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh>)"
{% endhint %}

Reference: <https://github.com/ohmyzsh/ohmyzsh>

## Install Homebrew

{% hint style="info" %}
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
{% endhint %}

## Install iTerm2

The simplest way to install iTerm2 is to download and unzip it: <https://iterm2.com/downloads.html>

## Install nerd-fonts

Clone the repo:

{% hint style="info" %}
git clone <https://github.com/ryanoasis/nerd-fonts.git>
{% endhint %}

Switch to the nerd-fonts folder and run:

{% hint style="info" %}
./install.sh
{% endhint %}

## Install powerlevel10k

just clone the repo to the ohmyzsh themes folder:

{% hint style="info" %}
git clone --depth=1 <https://github.com/romkatv/powerlevel10k.git> ${ZSH\_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
{% endhint %}

## Config .zshrc

change the theme to powerlevel10k:

{% hint style="info" %}
ZSH\_THEME="powerlevel10k/powerlevel10k"
{% endhint %}

setup the plugins:

{% hint style="info" %}
plugins=(git gitignore autojump wd docker zsh-autosuggestions zsh-syntax-highlighting)
{% endhint %}

### Install autojump

{% hint style="info" %}
brew install autojump
{% endhint %}

After visiting directories, use `j -s` to check the weights:

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxpNNv-4S3f8quXWClk%2Fuploads%2Fu42GzZxI5NFfdPJkQyi2%2Fimage.png?alt=media\&token=7ba2dc91-7ed0-414b-882d-6feda7cda8ad)

Use `j <dir>` to jump to a directory with highest weight:

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxpNNv-4S3f8quXWClk%2Fuploads%2FtPN82yOR2wytb209qJ2W%2Fimage.png?alt=media\&token=c3cacf24-3471-40a1-8120-829ea8aa91e1)

Find more by using:

{% hint style="info" %}
j -h

jc -h

jco -h
{% endhint %}

### Install zsh-autosuggestions

{% hint style="info" %}
git clone <https://github.com/zsh-users/zsh-autosuggestions> ${ZSH\_CUSTOM:-\~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
{% endhint %}

### Install zsh-syntax-highlighting

{% hint style="info" %}
git clone <https://github.com/zsh-users/zsh-syntax-highlighting.git> ${ZSH\_CUSTOM:-\~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
{% endhint %}

Don't forget to call

{% hint style="info" %}
source \~/.zshrc
{% endhint %}

## Configure Powerlevel10k

Now open a new iTerm and follow the wizard to configure the theme, if the wizard is not started automatically, type `p10k configure.`

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxpNNv-4S3f8quXWClk%2F-MjhQRHm4ffibdjO55vu%2F-MjhRTvre8T4FE0U1BSG%2Fconfiguration-wizard.gif?alt=media\&token=d66641b8-6c59-467e-9368-093d183a13f1)

Reference: <https://github.com/romkatv/powerlevel10k#oh-my-zsh>

## Clone iTerm2-Color-Schemes

{% hint style="info" %}
`git clone`[`https://github.com/mbadolato/iTerm2-Color-Schemes.git`](https://github.com/mbadolato/iTerm2-Color-Schemes.git)
{% endhint %}

Go to iTerm->Preferences->Profiles->Colors, you can import color schemes from iTerm2-Color-Schemes/scheme. I personally recommend "Chester".

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxpNNv-4S3f8quXWClk%2F-MjhQRHm4ffibdjO55vu%2F-MjhS6smH82OSMx9QSXh%2Fimage.png?alt=media\&token=c92ef7c0-14fe-4f7e-8932-25aa9c15df67)

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxpNNv-4S3f8quXWClk%2F-MjhQRHm4ffibdjO55vu%2F-MjhSpT8e14RqC5pQj8p%2Fimage.png?alt=media\&token=746b2b30-78e7-4ee7-8c5d-0d70ea4690b6)

Go to iTerm->Preferences->Profiles->Text, you can change the font

![](https://987171102-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxpNNv-4S3f8quXWClk%2F-MjhQRHm4ffibdjO55vu%2F-MjhThiYpy0omQN2fgxi%2Fimage.png?alt=media\&token=80569f44-6d8a-471a-bd44-8194329bbd07)
