首先安裝:
iTerm2、zsh(oh my zsh)
然後安裝powerline及其字體:
Installing Powerline on OS X
- Install python with homebrew:
brew install python
- Install vim with homebrew:
brew install vim --env-std --override-system-vim
. You must install vim after python so that it’ll compile with homebrew’s python. - Install powerline with pip:
pip install https://github.com/Lokaltog/powerline/tarball/develop
. Powerline should get installed to/usr/local/lib/python2.7/site-packages/powerline
. open /usr/local/lib/python2.7/site-packages/powerline
– you should see the files required for integration with zsh, vim, tmux, etc. in thebindings
directory. All you need to do now is to include these bindings in your zsh, vim and tmux config files – it’s that simple!- Add Powerline to vim by adding these lines to
~/.vimrc
:source /usr/local/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim set laststatus=2
- Add Powerline to tmux by adding this to
~/.tmux.conf
:source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
- Add Powerline to zsh by adding this to
~/.zshrc
:source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
If you use
oh-my-zsh
, be sure tosource
the Powerline bindings after oh-my-zsh’s. - Grab a patched font from https://github.com/Lokaltog/powerline-fonts (I use Inconsolata), and install it (just download, double-click the font file, and Install). If you don’t use any of these fonts, you’ll have to patch your favorite fontyourself (have fun with that!)