Blog

Configure Zsh on macOS

What can I say, I’m such a sucker for eye candy I couldn’t resist installing the ZSH shell and the Agnoster theme.

https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH

Install ZSH

I use Homebrew to install utilities.

1
2
brew install zsh zsh-completions

Set ZSH as default shell

1
2
chsh -s $(which zsh)

Install oh-my-zsh

oh-my-zsh is a package manager, the upside being themes support. There are others, but this is older, stable and still popular.

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

Configure color scheme for iTerm2

Solarized is nice

Powerline fonts

Patched Powerline fonts are used by many advanced themes and provides useful icons.

Make sure the fonts have been installed correctly. Either you can install them manually or run the install.sh script.

Configure fonts for iTerm2

Select the proper, pre-patched fonts marked as Powerline fonts. Make sure you set the fonts for non-ASCII as well.

Solarized Dark theme in iTerm2

This is how the Solarized Dark theme looks like in iTerm2 using above settings and the “agnoster” theme.

If you are on a newer MBP with a touch bar, you can change color themes within iTerm from the touch bar.

Setting oh-my-zsh theme

I’ve chosen the Agnoster theme. It looks great but may be sluggish on large sets. The are many alternatives that look similar, so try them out.

The Powerlevel9 theme is a well known alternative, which is supposedly great for prompt customizations and speed optimized (https://github.com/bhilburn/powerlevel9k)..)

Select theme (built-in) by editing the ~/.zshrc file.

Custom theme, such as the powerlevel9k theme, needs to be custom installed.

Intall the custom Powerlevel9k theme

1
2
git clone [https://github.com/bhilburn/powerlevel9k.git](https://github.com/bhilburn/powerlevel9k.git) ~/.oh-my-zsh/custom/themes/powerlevel9k

Specify the theme in the ~/.zshrc file:

1
2
ZSH_THEME="powerlevel9k/powerlevel9k"

Powerlevel9k in action