Additional Status for Vim With Powerline

· by Victor Mendonça · Read in about 1 min · (192 words) ·

Would you like to have more information displayed while reading files in VIM? Powerline is a great utility for that.

Imgur

In it’s default config, it displays:

  • Current mode (normal, insert, visual)
  • Git branch
  • File name
  • File encoding
  • Script type
  • File view percentage
  • Line number

To install it

Arch:

sudo pacman -Ss python-powerline powerline

Add the line below to your ~/.vimrc

set laststatus=2

Note: If you get the error below

Traceback (most recent call last):
  File "<string>", line 9, in <module>
ImportError: No module named powerline.vim
An error occurred while importing powerline module.
This could be caused by invalid sys.path setting,
or by an incompatible Python version (powerline requires
Python 2.6, 2.7 or 3.2 and later to work). Please consult
the troubleshooting section in the documentation for
possible solutions.
If powerline on your system is installed for python 3 only you
should set g:powerline_pycmd to "py3" to make it load correctly.
Unable to import powerline, is it installed?
Press ENTER or type command to continue

Modify either ~/.vimrc (or /etc/vimrc if you want the fix available for multiple users) by adding the line below:

let g:powerline_pycmd = 'py3'

Ubuntu 16.04

Use Python 3

code with