vimpowerlinevim-powerline

Powerline not work in vim


Ubuntu 16.04 installed sudo apt-get install powerline and added to .bashrc:

# Powerline
if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then
        source /usr/share/powerline/bindings/bash/powerline.sh
fi

And added in ~/.vimrc the:

" Powerline
set rtp+=/usr/share/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
let g:Powerline_symbols = "fancy"

when running again eg. vim ~/.vimrc there is no powerline nice status as here: https://www.2daygeek.com/wp-content/uploads/2017/06/install-powerline-in-linux-4.png

How can I fix this to get this fancy line in the bottom?


Solution

  • The problem is that apt-get is not installing bindings for vim. Use the pip installations instructions as explained:

    1. $ sudo apt-get install python-pip git
    2. $ sudo pip install git+git://github.com/Lokaltog/powerline
    $ pip show powerline-status
    Name: powerline-status
    Version: 2.6.dev9999+git.517f38c566456d65a2170f9bc310e6b4f8112282
    Summary: The ultimate statusline/prompt utility.
    Home-page: https://github.com/powerline/powerline
    Author: Kim Silkebaekken
    Author-email: [email protected]
    License: MIT
    Location: /usr/lib/python2.7/site-packages
    Requires: 
    
    1. Append to .bashrc
    if [ -f `which powerline-daemon` ]; then
      powerline-daemon -q
      POWERLINE_BASH_CONTINUATION=1
      POWERLINE_BASH_SELECT=1
      . /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
    fi
    
    1. $ source ~/.bashrc

    Details from here: https://www.2daygeek.com/powerline-adds-powerful-statusline-to-vim-bash-tumx-in-ubuntu-fedora-debian-arch-linux-mint/