Introducing Powerlevel9k theme for ZSH (and prezto)

There is a nice theme for the ZSH shell that I’ve found recently. It’s called Powerlevel9k and it uses Powerline patched fonts with additional symbols.

The installation of the theme is quite easy.

As I am using Prezto anyway I was able to install the theme with

$ git clone https://github.com/bhilburn/powerlevel9k.git  ~/.zprezto/modules/prompt/external/powerlevel9k

The correct symlink is made like this (otherwise if you use full path symlinks1 and use the same prezto configuration over multiple but different operating systems you might end up with the theme not loaded because that file won’t be found)

$ cd ~/.zprezto/modules/prompt/functions
$ ln -s ../modules/prompt/external/powerlevel9k/powerlevel9k.zsh-theme prompt_powerlevel9k_setup

To make use of the additional symbols you need to install an appropriate font. I used pre-patched Source-Code-Pro — but this is totally up to you.

Just copy the .ttf files into ~/.fonts and update your font-cache with

$ fc-cache -vf
  1. ~ gets expanded with the full path to your $HOME directory which is something like /home/user on Linux but /Users/user on macOS — and that is causing problems when you sync your prezto configuration over multiple OSes. 

Leave a Comment