How To Setup Your Mac Terminal
Customize Your Mac Terminal (Iterm2) with ZSH
How To Setup Your Mac Terminal
Let’s starting….
- Install Homebrew
- First thing you need is installing Homebrew, you can skip this if you’re already installed Homebrew.
Open up a terminal window and install homebrew with the following command:
1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Add Homebrew To Path
After installing, add it to the path. (replace
[username]
) with your actual username.
1
2
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[username]/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- Install iTerm2
Switch to iTerm2 for the remainder of this walkthrough.
- Install Git
If you don’t have it installed, install git as well use homebrew to install it.
1
brew install git
- Install Oh My Zsh
Now you need to install Oh my Zsh.
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- Install PowerLevel10K Theme for Oh My Zsh
Run this to install PowerLevel10K.
1
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.
1
ZSH_THEME="powerlevel10k/powerlevel10k"
To reflect this change on your terminal, restart it or run this command below.
1
source ~/.zshrc
- Install Meslo Nerd Font
Install the font by pressing “y” and then quit iTerm2.
- Update VSCode Terminal Font
(Optional)
Open settings.json and add this line.
1
"terminal.integrated.fontFamily": "MesloLGS NF"
- Configure PowerLevel10K
Restart iTerm2.
You should now be seeing the PowerLevel10K configuration process. If you don’t, run the following.
1
p10k configure
Follow the instructions for the PowerLevel10K configuration to make your terminal look as desired.
- Increase Terminal Font Size
- Open iTerm2 preferences
- Go to Profiles > Text
- Increase my font size to about 20px
- Change iTerm2 Colors to My Custom Theme
- Open iTerm2
- Download my color profile by running the following command (will be added to Downloads folder).
1
curl https://raw.githubusercontent.com/josean-dev/dev-environment-files/main/coolnight.itermcolors --output ~/Downloads/coolnight.itermcolors
- Open iTerm2 preferences.
- Go to Profiles > Colors.
- Import the downloaded color profile (coolnight).
- Select the color profile (coolnight).
You can find other themes here the link: Iterm2 Color Schemes
- Install ZSH Plugins
Install zsh-syntax-highlighting.
1
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.
1
plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)
Load these new plugins by running.
1
source ~/.zshrc
- You’re Done!
With that, you’re finished and should have a much better terminal experience! :')