- Install pip
sudo apt-get install python-pip
- Install powerline
sudo pip install powerline-status
- Install fonts
sudo apt-get install fonts-powerline
- Add these lines to respective files:
.vimrc
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256
.bashrc
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
fi
if [ -f /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh
fi
.zshrc
if [[ -r /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
fi
.tmux.conf
source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"
Credits
- Adapted from: https://gist.github.com/leosuncin/25bad6ae66c5d513b986
I got following error
You need vim compiled with Python 2.6, 2.7 or 3.2 and later support
So had to recompile the vim. I thought it would be great to share it with everyone. Run the following code to compile vim with python 2.7 support.
cd /tmp && git clone https://github.com/vim/vim.git && cd vim ./configure --enable-pythoninterp --prefix=/usr make && sudo make install
Also, I changed the powerline.conf path to /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf for tmux