19

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 Answers8

27

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.

GmonC
  • 2,402
6

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.

5

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.

Jawa
  • 3,679
2

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.

Jawa
  • 3,679
garyjohn
  • 36,494
2

I 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:

  1. Click on download zip (https://github.com/bling/vim-airline) and unzip it.

  2. 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 $HOME in vim.

    For Linux Users:

    Copy all the contents in vim-airline-master and paste it into $HOME/.vim directory using command cp -r.

  3. Now Open your .vimrc file by running the command :edit $HOME/.vimrc. Add the following line into your .vimrc file.

    set laststatus=2

    Reason: 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 laststatus in vim.

  4. Finally To add help for vim-airline run the following command in vim.

    For Windows Users:

    :helptags $HOME\vimfiles\doc
    

    For Linux User:

    :helptags $HOME/.vim/doc
    
  5. Run :help airline in vim for more help and configurations.

    Enjoy the colorful line!!

1

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.

Jawa
  • 3,679
jaychris
  • 378
1

Even once you have a plugin properly installed, you may need to do this to make its help file accessible:

:helptags ~/.vim/doc

After that, running ":help airline" should work and it should tell you how to properly set it up for use in your Vim environment.

Heptite
  • 20,411
0

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 https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline

Without 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
Roland Smith
  • 2,048