Powerline

Powerline provides an enhanced status line for Vim, as well as providing other functions, such as extending your shell prompt or tmux status line. It is available (along with detailed installation instructions) from https://github.com/powerline/powerline. When enabled in Vim, it looks something like this:

As you can see, it displays a plethora of information, including current mode, Git branch, filename, status of a current file, file type, encoding, and how far along you are in a current file. It's fully customizable, and lets you display as much or as little information as you want.

It's a bit of trouble to install, since it's not just a Vim plugin. First, you'll need to install the powerline-status package through pip:

$ python3 -m pip install powerline-status

If you don't have pip installed, see the technical requirements at the beginning of this chapter for setup instructions.

You'll also need to make sure $HOME/.local/bin (the default scripts location for pip) is on your path by adding the following to your .bashrc:

PATH=$HOME/.local/bin:$PATH

 

 

Finally, set laststatus to 2 (to make sure the status line is always displayed), and load Powerline in your .vimrc:

" Always display status line (or what's the purpose of having powerline?)
set laststatus=2

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

Now, reload your Vim configuration (:w | source $MYVIMRC), and you'll see the fancy new status line at the bottom of your screen:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.39.74