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.
Check the project's FAQ.
vim-airline doesn't appear until I create a new split
Add
set laststatus=2
to 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 https://github.com/bling/vim-airline
They recommended several package managers - I picked the first one:
Pathogen
git clone https://github.com/bling/vim-airline ~/.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.
Those 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.