Skip to content

Instantly share code, notes, and snippets.

@7hunderbird
Forked from wm/Powerline.md
Created January 9, 2017 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7hunderbird/38703623133fcca3d1dca24ad3306340 to your computer and use it in GitHub Desktop.
Save 7hunderbird/38703623133fcca3d1dca24ad3306340 to your computer and use it in GitHub Desktop.
Installing powerline on Mac OSX. The following was done in version Version 10.8.2

Install dependencies

brew install cmake
brew install python
sudo easy_install pip

Add powerline bin to your path. In your zshrc file (or the paths files sourced in zshrc) add the following line

PATH="/usr/local/share/python/:$PATH"

Reinstall MacVim with brew

I needed to edit the formula to specify which python to build against.

brew edit macvim

Edit it as follows (tip is from here)

Find the arguments list (begins with args = %W[ ...), and modify this line:

--enable-pythoninterp

Change it to these two lines:

--enable-pythoninterp=dynamic
--with-python-config-dir=/usr/local/lib/python2.7/config

On my system the above folder did not exist so I had to link it as follows

ln -s /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current/lib/python2.7/config /usr/local/lib/python2.7/config

then reinstall it

brew remove macvim
brew install macvim --env-std --override-system-vim

Install powerline

pip install --user git+git://github.com/Lokaltog/powerline --verbose

Install fonts

Install the fonts by downloading them (https://github.com/Lokaltog/powerline-fonts/tree/master/Meslo), click on them, and then click install in the application that opens.

Usage

Add the following to your dot files

.vimrc

set rtp+=/usr/local/lib/python2.7/site-packages/powerline/bindings/vim

if has("gui_running")
   let s:uname = system("uname")
   if s:uname == "Darwin\n"
      set guifont=Meslo\ LG\ S\ for\ Powerline
   endif
endif

Note: Use your desired font in place of Meslo above. The first line is needed for all vim and the next few lines are needed for MacVim GUI.

.zshrc

. /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh

.tmux.conf

source '/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf'

Installing iTerm from source

I needed to do this because my Fonts were not working. Without this it looked like ↓

It will build and launch iTerm. Then copy the app to /Applications. It will be something like:

mv /Users/wmernagh/Library/Developer/Xcode/DerivedData/iTerm-dmqofiayvqouzqakzaudepvpnfgb/Build/Products/Development/iTerm.app /Applications

Configure iTerm to use the powerline fonts

In Preferences > Profiles > Text and select the fonts:

Result

If all goes well it should look like this:

vim (MacVim launched as vi or vim in the iTerm2)

MacVim GUI

zsh

tmux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment