VIM for IDE people - part 5

Lightweight status line: vim-airline

When editing a file in a plain vanilla VIM instance (simulate this by opening VIM like this: vim -u NORC [file]), there’s not much to see. In fact, there is no information at all about the file you’re editing, except maybe the filename in the window title bar.

Maybe that’s good enough for you. But what if you could have this:

  • Indication of the mode (insert/replace/visual/…)
  • Filename
  • File type
  • File encoding
  • Line & column number
  • Git information
  • Info/error/warning messages

If you’re thinking “ow yes, that sounds usefull”, then the next part definitely is for you.

What is vim-airline?

Some clever people thought the above sounded like a usefull idea and went ahead and created a plugin for this. The mother of status line implementations is vim-powerline. This project however, is deprecated in favor of powerline.

Powerline is a complete rewrite of the original vim-powerline in Python. If you don’t like Python or are more partial to using VimL, then there’s vim-airline for you.

Vim-airline is a lightweight clone of Powerline, writen in VimL, which has support for color schemes, is completely extendible, has integration for other tools and much much more. Go look at the website if you want the full list.

After installation of vim-airline (see installation instructions), see the help tags (:help airline) for all the configuration options. The ones I used are:

  • let g:airline_theme='solarized' For the solarized theme
  • set laststatus=2 To always display airline (default is only after a split)

That’s right, only 2 configuration options. I’m happy with the default behavior. Try it out, there’s nothing to dislike really…

Vim For IDE-people

This article is part of the series “Vim For IDE-people”. The other articles in the list are:

  1. Basic Vim configuration and plugins
  2. Solarized color scheme
  3. File system explorer: NERDTree
  4. Syntax checking: Syntastic
  5. Lightweight status line: vim-airline

Comments