The following distribution-specific packages are officially supported, and they provide an easy way of installing and upgrading Powerline. The packages will automatically do most of the configuration for you, but you should still skim through this guide so you know how the plugin works.
If you’re running a distribution without an official package you’ll have to follow the installation guide below:
Install Python 3.2+ or Python 2.6+.
Install Powerline using the following command:
pip install --user git+git://github.com/Lokaltog/powerline
Note
You need to use the GitHub URI when installing Powerline! This project is currently unavailable on the PyPI due to a naming conflict with an unrelated project.
Powerline provides two ways of installing the required fonts on Linux. The recommended method is using fontconfig if your terminal emulator supports it. See the Application/terminal emulator feature support matrix for details about what features your terminal emulator supports.
You need to tell tmux that it has 256-color capabilities. Add this to your .tmux.conf to solve this issue:
set -g default-terminal "screen-256color"
If you’re using iTerm2, make sure that you have enabled the setting Set locale variables automatically in Profiles ‣ Terminal ‣ Environment.
Assuming powerline was working before update and stopped only after there are two possible explanations:
In the second case you, of course, should report the bug to powerline bug tracker. In the first you should make sure you either have only one powerline installation or you update all of them simultaneously (beware that in the second case you are not supported). To diagnose this problem you may do the following:
If this problem is observed within the shell make sure that
python -c 'import powerline; print (powerline.__file__)'
which should report something like /usr/lib64/python2.7/site-packages/powerline/__init__.pyc (if powerline is installed system-wide) or /home/USER/.../powerline/__init__.pyc (if powerline was cloned somewhere, e.g. in /home/USER/.vim/bundle/powerline) reports the same location you use to source in your shell configuration: in first case it should be some location in /usr (e.g. /usr/share/zsh/site-contrib/powerline.zsh), in the second it should be something like /home/USER/.../powerline/bindings/zsh/powerline.zsh. If this is true it may be a powerline bug, but if locations do not match you should not report the bug until you observe it on configuration where locations do match.
If this problem is observed within the vim instance you should check out the output of the following Ex mode commands
python import powerline as pl ; print (pl.__file__)
python3 import powerline as pl ; print (pl.__file__)
One (but not both) of them will most likely error out, this is OK. The same rules apply as in the 1), but in place of sourcing you should seek for the place where you modify runtimepath vim option. If you install powerline using VAM then no explicit modifications of runtimpath were performed in your vimrc (runtimepath is modified by VAM in this case), but powerline will be placed in plugin_root_dir/powerline where {plugin_root_dir} is stored in VAM settings dictionary: do echo g:vim_addon_manager.plugin_root_dir.
There is a hint if you want to place powerline repository somewhere, but still make powerline package importable anywhere: use
pip install --user --editable path/to/powerline
You need to configure the fillchars setting to disable statusline fillchars (see :h fillchars for details). Add this to your vimrc to solve this issue:
set fillchars+=stl:\ ,stlnc:\
This happens because z is launching some jobs in the background from $POWERLINE_COMMAND and these jobs fail to finish before powerline prompt is run.
Solution to this problem is simple: be sure that z.sh is sourced strictly after powerline/bindings/bash/powerline.sh. This way background jobs are spawned by z after powerline has done its job.