The Pathogen (formerly knows as Vundle) plugin for vim is an extremely useful plugin manager. It can automatically download other plugins from github (and other locations). One downside is that Pathogen must be manually downloaded and copied in the correct folder. However, I added the following lines in .vimrc to check if Pathogen is already installed on the system, and if not, to download it.
let vundleInstalled=0
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
silent !mkdir -p ~/.vim/bundle/
silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
let vundleInstalled=1
endif
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
...
if vundleInstalled == 1
:PluginInstall
endif
I have my .vimrc on github and whenever I move to a new system I simply copy the file in my home folder. The first time I run vim, it will read .vimrc and will install Pathogen alongside with all the other plugins specified.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment