Skip to content

My Powerline setup and configuration#


If you're working in an enterprise environment, and you don't have the admin rights on your Windows desktop to install additional fonts, or your enterprise admin cannot do that, then I suggest you to ignore this post, powerline will be installed, but very ugly. If you have a Linux desktop, all will be OK, installing fonts doesn't need to be root.

Installing powerline-status from pip#

pip3 install powerline-status --user
pip3 show powerline-status
user_python_site_packages=$(pip3 show powerline-status | grep Location: | awk '{print $2}')
mkdir -p ~/.config/powerline
cp -r $powerline_global_config_files_path/. ~/.config/powerline

Installing fonts#

apt install fontconfig
mkdir -p ~/.local/share/fonts/
mkdir -p ~/.config/fontconfig/conf.d/
mv PowerlineSymbols.otf ~/.local/share/fonts/
fc-cache -vf ~/.local/share/fonts/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/

Installing additional fonts#

Adding VIM support#

If Python support is absent then Vim needs to be compiled with it. To do this use --enable-pythoninterp ./configure flag (Python 3 uses --enable-python3interp flag instead). Note that this also requires the related Python headers to be installed. Please consult distribution’s documentation for details on how to compile and install packages.

Check VIM with python support:

vim --version | grep +python

if you don't have +python or +python3, you can install VIM from source by enable python support:

Add following lines to $HOME/.vimrc:

python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup

Adding Ipython support#

Doesn't work for ipython v7+:

Adding PBD support#

Adding Bash support#

Add following lines to ~/.bashrc:

python path must be available before powerline-daemon -q

powerline-daemon -q
. {repository_root}/powerline/bindings/bash/

<!-- more -->

Adding Git support#

pip3 install powerline-gitstatus

Add to ~/.config/powerline/colorschemes/default.json:

  "groups": {
    "gitstatus":                 { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch":          { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_clean":    { "fg": "green",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_dirty":    { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_detached": { "fg": "mediumpurple",    "bg": "gray2", "attrs": [] },
    "gitstatus_tag":             { "fg": "darkcyan",        "bg": "gray2", "attrs": [] },
    "gitstatus_behind":          { "fg": "gray10",          "bg": "gray2", "attrs": [] },
    "gitstatus_ahead":           { "fg": "gray10",          "bg": "gray2", "attrs": [] },
    "gitstatus_staged":          { "fg": "green",           "bg": "gray2", "attrs": [] },
    "gitstatus_unmerged":        { "fg": "brightred",       "bg": "gray2", "attrs": [] },
    "gitstatus_changed":         { "fg": "mediumorange",    "bg": "gray2", "attrs": [] },
    "gitstatus_untracked":       { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
    "gitstatus_stashed":         { "fg": "darkblue",        "bg": "gray2", "attrs": [] },
    "gitstatus:divider":         { "fg": "gray8",           "bg": "gray2", "attrs": [] }

Add to ~/.config/powerline/themes/shell/default.json:

    "function": "powerline_gitstatus.gitstatus",
    "priority": 40

Add to ~/.config/powerline/themes/shell/__main__.json:

"gitstatus": {
    "args": {
        "show_tag": "exact"