Prabhakar Kasi iOS Developer, Front End Developer

Configure iTerm2 + zsh + oh-my-zsh for powerful terminal experience on macOS

1 min read

Being a developer we spent lot of time in terminal. It would be nice to have more powerful, informative and beautified terminal experience.

The default terminal looks like this. Below I have captured snapshot of terminal at each step.

Default Terminal
  1. Download and Install iTerm2 – https://iterm2.com/
iTerm2 Terminal
  1. Install oh my zsh – https://ohmyz.sh/
Oh My Zsh – Default Theme “robbyrussell”
  1. Explore and update ZSH theme – https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

If you pick “agnoster” theme, then we need to install special font for it to render properly

vi ~/.zshrc
#Update existing value
ZSH_THEME="agnoster"
Oh My Zsh – Theme “agnoster”
  1. Install powerline font – https://github.com/powerline/fonts
# Clone repo, install and clean up
git clone git@github.com:powerline/fonts.git
cd fonts
./install.sh
cd ..
rm -rf fonts
  1. Update iterm2 font preference

Recommended to duplicate profile so that you can always go back if you don’t like this experience

Open iTerm2 preference and update the text to “Meslo LG L DZ for Powerline” or any powerline font

iTerm2 -> Preferences -> Profile -> Text -> Meslo LG L DZ for Powerline
Oh My Zsh – Theme “agnoster” with Powerline font
  1. Update iterm2 color

Now the terminal is looking better but a different colors would make it more readable and pleasant we need to pick a color scheme that work for this theme.

iTerm2 -> Preferences -> Profile -> Color -> Color Presets -> Solarized Dark
iTerm2 preference
Oh My Zsh – Theme “agnoster” with Powerline font and color preset
  1. Explore and import the color scheme you like – https://iterm2colorschemes.com/

I have a archived the color schemes I like here. You can download and import them in iTerm2 profile colors schemes.

iTerm2 -> Preferences -> Profile -> Color -> Color Presets -> Import
iTerm2 -> Preferences -> Profile -> Color -> Color Presets -> Hovering your mouse over color-schemes show the preview of the terminal
ChallengerDeep color scheme
Relaxed color scheme

Reference

  1. https://github.com/2raptor/setup-guide
Prabhakar Kasi iOS Developer, Front End Developer

Leave a Reply