Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to manage vim plugin

Tags:

vim

I want to know how do you manage your vim plugins.

As it is, One of the biggest fun of using is that one can easily try many interesing new plugins, just download it and unzip it in under ~/.vim. But if you try too often and try too much, you might get trouble as confilct of key mapping , in compatitble script version, dpendency between different plugin .....

Then you want to remove some plugin ,kind of like rollback your vim to a sound condition. But, the rollback could be very painful . cus for some "giant" plugin, like perl-support ( it's great plugin, anyway), will consist of many vim scripts which spread in different dirctories. To remove single one giant plugin will be anoying, not too mention if you remvoe many plugin at one time.

In a word , I'm looking for good practice for managing vim plugins.

like image 969
Haiyuan Zhang Avatar asked Mar 11 '10 13:03

Haiyuan Zhang


Video Answer


2 Answers

I have my vim directory in git.

All plugins that have an upstream public git repo are in ~/.vim/plugins-git/ as git submodules. My vimrc sets the runtimepath to include the directories in ~/.vim/plugin-git/ so the plugins can stay self contained and can very easily be updated to the latest git commit.

The rest of my plugins are in ~/.vim/plugin/.

One script that's out there that makes this type of setup much easier is pathogen.vim. pathogen.vim sets up all the runtimepath entries for you so you don't have to. It's worth looking into for sure. I don't use pathogen because by setting the paths explicitly in my vimrc I can quickly disable plugins if there are conflicts or incompatibilities like you mentioned.

like image 101
Randy Morris Avatar answered Oct 03 '22 10:10

Randy Morris


Vundle definitely deserves a mention, as it makes vim plugin management ridiculously simple.

 1. git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
 2. open up your vimrc
 3. Add your plugins (Bundle '<link to plugin>') <-- look at the example vimrc on Vundle github page
 4. :BundleInstall

I think Vundle was inspired from tpope's Pathogen plugin.

like image 32
Prashant Avatar answered Oct 03 '22 10:10

Prashant