Skip to content

Instantly share code, notes, and snippets.

@wm
Last active September 6, 2022 00:55
Show Gist options
  • Star 96 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • Save wm/4750511 to your computer and use it in GitHub Desktop.
Save wm/4750511 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

@jnelson
Copy link

jnelson commented Feb 27, 2013

Thank you; this worked without modifications on 10.6.8.

@viktormadarasz
Copy link

Someone has a working walkthrough for OS X 10.11?

Everything installs OK but never seem to activate powerline in neither VIM nor Tmux or ZSH

@saurabh-hirani
Copy link

Thanks for the detailed steps. This worked on Mac OS Sierra.

@mgild
Copy link

mgild commented Mar 2, 2017

only guide that has worked for me thank you.
brew install macvim --env-std --override-system-vim
It seems that --env-std is no longer necessary.

It seems that iterm does not need to be built from source either.

@toonsend
Copy link

Thank you, thank you, thank you. This works a treat.

@pcnerd1
Copy link

pcnerd1 commented Jan 10, 2018

Could not get it to work on MAC OS High Sierra. Everything installs fine, just doesn't activate for VIM

@richardleandro1
Copy link

Thank you! i'll try now on the high sierra

@msisto
Copy link

msisto commented Jul 30, 2018

Thanks!

@Chibbluffy
Copy link

Mid 2019 homebrew removed options. --override-system-vim and any other brew options no longer work. Just a heads up

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