Vim Airline Setup


I was watching this video on how to use vim+tmux effectively (Video Link), and this guy had some really awesome looking vim. I decided to try it out and see if I could end up with something just that great.

I did my research and found two alternatives, powerline and vim-airline. Powerline is pretty heavy and vim-airline states itself to be lightweight, so I went ahead and installed vim-airline.

"Added so that vim airline can get git info
Plugin 'tpope/vim-fugitive'
Plugin 'vim-airline/vim-airline'

After this I just run :PluginInstall.

However, after installation, the statusline did not look that great. I needed to do something more. I foundout that vim-airline needs some special fonts so that it can display some things properly, like the > and <. To do this, I had to install powerline fonts. I followed the instruction found here: powerine fonts and ended up installing the powerline fonts.

I then switched to a powerline font in Xfce4-terminal. I use DejaVu Sans Mono for Powerline Book.

But still this was not enough. I then had to go to my .vimrc and add some few more sections.

"To allow colors in the status line
set t_Co=256
"To allow status bar to be seen even before splitting
set laststatus=2
"To allow powerline symbols to be seen
let g:airline_powerline_fonts=1

With all this I had almost reached my goal. However, I have a 10.1" screen laptop, and the status bar seemed to be hiding some details because of the little screen landscape. So I decided to change some sections. After some digging I added this to my .vimrc

"Reduces the space occupied by section z
let g:airline_section_z = "%3p%% %l:%c"

And now I have a pretty decent status bar.