Pro 🔥 Terminal Experience using iTerm on macOS

Sai Ankit
4 min readJun 21, 2020

--

In this reading I will guide you step by step on setting up a Pro Terminal (iTerm) on your machine.

Homebrew

The first and foremost important thing you must be having on your machine before moving any further is homebrew. To install Homebrew you can visit the official website or directly paste the given command in your terminal.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

iTerm 2

To install iTerm on your machine, you can visit their official page and download it from there or since you are equipped with Homebrew you can install using it by typing this command in your terminal.

brew cask install iTerm2

Transition to ZSH

brew install zsh

Oh-My-ZSH 🚀

Install this cool framework to manage your ZSH terminal.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

In case the default shell isn’t changed to zsh by mistake if you haven’t responded YES to the change then use this to transit into ZSH

chsh -s /bin/zsh

Theming your iTerm 🔥

Your default ZSH Theme would be ‘robbyrussell’. You will have to change it to your preferred theme. The most famous one’s are Powerlevel9K/10K and Agnoster.

I personally prefer ‘agnoster’ ( Don’t know why but it looks great to me 🤷‍♂ )

‘Agnoster’ with my Own theming tweaks — ( Spiderman Background -Don’t mention )

Change to Agnoster 👊

  1. Head over to your main Root directory
cd

2. Open the .zshrc file

open ~/.zshrc

If you want the .zshrc file to open in VS Code

code ~/.zshrc

3. Change the ZSH_THEME from ‘robbyrussell’ 👉 ‘agnoster’

Restart iTerm to apply the changes.

Weird Symbols Fix

There would be hell lot of weird symbols on your iTerm.

Don’t Panic !! It happens only because you haven’t installed the required fonts.

To handle Agnoster theme properly you need Powerline Fonts.

# Cloning
git clone https://github.com/powerline/fonts.git

# Installation
cd fonts
./install.sh

# Clean up
cd ..
rm -rf fonts

Open the Preferences of iTerm2 by pressing “⌘ ➕ ,”

Head over to Profiles ➡️ Text ➡️ Font

Choose a font that appeals you the most. The most famous ones that are being used are ProFont for Powerline ( My personal Fav ❤️ ), Meslo LG S DZ for Powerline ( A good one too 💛 ), Menlo for Powerline ( Another great Font 💙 )

Choose Regular and font Size that suits well for you.

Color Color ❤️ 💛 💚 💙

Head over to Profiles ➡️ Colors ➡️ Color Presets and enable Solarized Dark which is the most famous in use.

But I personally tweaked the colors based on my own Preferences and materialized a Color Palette that appealed me.

My Own Color Palette — Royalty Free 😉

My Color Palette — Hex Codes

ansiBlack : "#000000"
ansiBrightBlack : "#414141"
ansiBlue : "#bceafa"
ansiBrightBlue : "#77dcff"
ansiCyan : "#a3e9d4"
ansiBrightCyan : "#a3e9d5"
ansiGreen :"#68f400"
ansiBrightGreen : "#dcf152"
ansiMagenta : "#f58a8d"
ansiBrightMagenta : "#ffb4b8"
ansiRed : "#ff4c41"
ansiBrightRed : "#ff7c77"
ansiWhite : "#ffffff"
ansiBrightWhite : "#ffffff"
ansiYellow : "#ffe100"
ansiBrightYellow : "#fff68b"

You can also choose / create a custom color pallete which you can import whenever you setup your iTerm2. I tend to change my color palette regularly and try different ones, You can find my current color palette here https://github.com/saiankit/mac-setup/blob/master/colorPresets.itermcolors

Further Tweaking

#1

If you don’t want the machine and user name at the start of each line like

username@my-MacBookPro

Add this following piece of code at the end of your .zshrc file

Scroll above to find the procedure to open your .zshrc file

prompt_context() {   if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then      prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"   fi}//Indent this stuff properly !!

There are also couple of plugins I use to improve my productivity

  1. zsh-autosuggestions
    Install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

and add zsh-autosuggestions in the plugins line of .zshrc

Yeah !!! 😄

You have a great looking Terminal on your machine 🚀

Please do have a look into my YouTube channel: Code Studio Sai Ankit that discusses everything related to coding from Computer Science Concepts, Competitive Coding tutorials, Codeforces Editorials, Development Projects.
Please also do leave a like and Subscribe on the content you like 👍.

--

--

Sai Ankit
Sai Ankit

Written by Sai Ankit

Senior | Youtuber | Developer

No responses yet