Vim: How to Install Airline?
I'm just getting started with Vim. It's a fun experience, but I've found it to be kind of overwhelming. I'm trying to get this plugin installed, vim-airline, but I'm having a lot of trouble. The Installation section on the Github page simply states:
copy all of the files into your ~/.vim directory
Presumably, this means download the .zip, extract it, and copy all of those files into ~/.vim/. I did this, but Vim just starts up like normal, and running :help airline just gives:
Sorry, no help for airline
I assume that this means it isn't getting installed. Also, the statusbar remains the same. I'm new to Vim and would really like to get this working. Thanks in advance!
EDIT: I also tried putting the files into /usr/share/vim/vim73/. No dice.
EDIT 2: I ran :helptags ~/.vim/doc and now the help-page displays when I type :help airline, but I'm still not getting the plugin itself (the status bar). Vim looks the same, but it can now display the help page.
8 Answers
Check the project's FAQ.
vim-airline doesn't appear until I create a new split
Add
set laststatus=2to your vimrc.
Inside vim, do :h laststatus to understand why this is needed. If you want to know in the future if a plugin is being "loaded" or not, check :scriptnames.
I installed airline using install instructions from
They recommended several package managers - I picked the first one:
Pathogen
git clone ~/.vim/bundle/vim-airline
I got :help airline to work with this command:
:helptags ~/.vim/bundle/vim-airline/doc
Like you, now the help-page displays when I type :help airline.
When you download the latest version of vim-airline as .zip and unzip it to a temporary directory, you get a vim-airline-master directory in the temp directory. Inside vim-airline-master you'll find autoload, doc and plugin directories. You should either
- copy these three directories to your
~/.vim/if they don't yet exist (don't overwrite existing directories with same names!) or - copy the contents of the aforementioned three directories to existing directories under
~/.vim/
However, as a side note, I strongly suggest looking into Pathogen as I've found it the most trouble-free way to play with Vim plugins.
2Those manual installation instructions assume a lot -- I would say they're just wrong. The plugin files should actually be copied into various subdirectories of your ~/.vim directory.
I downloaded the zip file from its Vim scripts page and took a look.
The doc/airline.txt file goes into your ~/.vim/doc subdirectory. The plugin/airline.vim file goes into your ~/.vim/plugin subdirectory. The autoload/airline.vim file goes into your ~/.vim/autoload directory as does the autoload/airline directory and all its contents.
This is one of those more complicated plugins that should probably be installed using a plugin manager, but I wouldn't worry about that until you get a little more experience with Vim.
1I was able to install vim-airline for gvim on Windows platform. But you should be able to follow the same process for linux based OS as well and install it without any problem.
NOTE: This installation procedure is manual.
Do the following steps to install vim-airline:
Click on download zip () and unzip it.
For Windows Users:
Copy all the contents in vim-airline-master and paste it into $HOME\vimfiles folder. If vimfiles folder is not present then create a new folder named vimfiles in your home folder.
you can find your home folder by running the command
:echo $HOMEin vim.For Linux Users:
Copy all the contents in vim-airline-master and paste it into $HOME/.vimdirectory using command
cp -r.Now Open your .vimrc file by running the command
:edit $HOME/.vimrc. Add the following line into your .vimrc file.set laststatus=2Reason: The default setting of 'laststatus' is for the statusline to not appear until a split is created. If you want it to appear all the time, add the following to your vimrc: set laststatus=2
For more details run the command
:help laststatusin vim.Finally To add help for vim-airline run the following command in vim.
For Windows Users:
:helptags $HOME\vimfiles\docFor Linux User:
:helptags $HOME/.vim/docRun
:help airlinein vim for more help and configurations.Enjoy the colorful line!!
I believe the files were not copied in the right place.
Under .vim directory, plugin, doc and autoload directories should go. I suspect vim-airline-master directory went under .vim directory and that is why the plugin is not getting set up.
Even once you have a plugin properly installed, you may need to do this to make its help file accessible:
:helptags ~/.vim/docAfter that, running ":help airline" should work and it should tell you how to properly set it up for use in your Vim environment.
Do yourself a favor and install a plugin manager like pathogen.
It makes handling plugins a lot easier.
Once you have pathogen set up, installing airline is simple. If you have git:
git clone ~/.vim/bundle/vim-airlineWithout git you have to download the zipfile vim-airline-master.zip. Then:
cd ~/.vim/bundle
unzip ~/vim-airline-master.zip
mv vim-airline-master vim-airline 2