Install Powerline for Mac OS X

Powerline is a shell prompt and statusline plugin for vim, written in Python. It makes working with terminal much more fun and colorful. Here is an example of how the prompt looks like with Powerline.

As you can see from the screenshot, powerline gives you a colorful and visual attractive prompt. If you are in a git repository, it also tells you which branch you are currently working on. It also tells you the exit code of previous process (the number in the last red tab), etc. In this post, I'll show you how to install and setup powerline for Mac OS X bash shell and vim.


First, make sure you have python version 2.6 or later. Then download and install pip

$ python --version
Python 2.7.5

$ wget
$ sudo python

If you didn't know, pip is a package management system used to install and manage software written in Python. It's equivalent to npm for nodejs or Maven for Java. Now you can use pip to install powerline

$ pip install --user git+git://

$ pip show powerline
You are using pip version 6.0.7, however version 6.0.8 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Powerline should be installed at ~/Library/Python//lib/python/site-packages/powerline. In my system, it's at ~/Library/Python/2.7/lib/python/site-packages/powerline


You will need to get powerline source code either by cloning it from git repository or download its zip file. Then copy the powerline/ and scripts directories from source code directory to where you had powerline installed.

$ POWERLINE_PATH=~/Library/Python/2.7/lib/python/site-packages/
$ git clone
$ cp -r powerline/powerline/ $POWERLINE_PATH/powerline
$ cp -r powerline/scripts/ $POWERLINE_PATH/scripts

To activate powerline, you need to tell .bash_profile to load file.

$ vi ~/.bash_profile

source $POWERLINE_PATH/bindings/bash/

Now, create a configuration directory for powerline in your home directory and copy the config_files/ directory from the source code directory there.

$ mkdir ~/.config/powerline 
$ cp -r ./powerline/powerline/config_files/ .config/powerline/

Changing fonts

The source code that you have just cloned earlier comes with 1 font in the font/ directory (PowerlineSymbols.otf). But you can find more fonts for powerline here. Use Font Book to install font you like.

Display git branch

In order to display git branch in powerline prompt, you need to look for settings for shell in config.json and replace default theme with default_leftonly.

$ vi ~/.config/powerline/config.json

"shell" {
  "theme": "default_leftonly",

Enable powerline for vim

Add the following into .vimrc to enable powerline for vim.

$ vi ~/.vimrc
set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/


  1. Hmmm I couldn't get this to work. I'm using ZSH and I changed
    `source $POWERLINE_PATH/bindings/bash/`
    `source $POWERLINE_PATH/bindings/zsh/powerline.zsh`

    but it's still not working for me.

    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Node JS Online Training from India . or learn thru Javascript Online Training from India. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Online Training

  2. After a lot of digging and this post got me 90% of the way there. The last part was setting the font correctly in the .vimrc file which I found here: