Rafid
Rafid

Reputation: 20239

Uninstalling Plugin in Vim

After installing many plugins in my ~/.vim folder, I feel I no more understand the contents of that folder and I don't feel enough confidence about deleting the plugin from ~/.vim/plugin to uninstall a plugin. What if there are related files in other directories? What if the documentation was already registered (:helptags), yet the plugin will be removed? Is there any procedure to uninstall vim-plugins? I don't really want my Vim to end up being as messy as my Windows.

Upvotes: 36

Views: 60156

Answers (5)

Jogendra Kumar
Jogendra Kumar

Reputation: 1184

You can simply run:

vim +PlugClean

OR open vim and run :PlugClean.

On running this command, it will ask you to remove the plugin directories. answer with y and it will clean the plugs.

Upvotes: 6

Elliptical view
Elliptical view

Reputation: 3812

Interestingly, even the much downloaded Pathogen.vim documentation boldly suggests (their emphasis, not mine):

For new users, I recommend using Vim's built-in package management instead. :help packages


Ok, I can take a hint, that pathogen is not for most of us new users.

So then looking into native vim packages, and what it has to offer...

The skinny from :help packages seems to be this:

... A package can be downloaded as an archive and unpacked in its own directory.

Thus the files are not mixed with files of other plugins.

That makes it easy to update and remove.

Upvotes: 2

Benjamin guo
Benjamin guo

Reputation: 121

If you install vim plugin via Vundle, it's easy to uninstall plugin, comment out the plugin in .vimrc, example:

"Bundle 'tmhedberg/SimpylFold'

then

:BundleClean  

common commands of Vundle: :BundleList -List all plugins
:BundleInstall -Install all plugins
:BundleInstall! -Update all plugins
:BundleSearch foo -Find foo plugin
:BundleSearch! foo -refresh buffer for foo plugin
:BundleClean -clean all plugins if the plugin not defined in .vimrc

Upvotes: 12

SergioAraujo
SergioAraujo

Reputation: 11820

To manage easily plugins in vim use pathogen and this awesome article --> come home to vim

Upvotes: 13

ZyX
ZyX

Reputation: 53654

If you want to uninstall a plugin which was installed into ~/.vim manually, you should redownload its archive, list its content and manually remove everything, then run :helptags again (this will remove missing tags). If plugin was installed from a vimball, see documentation for :RmVimball. Vimball archives normally have .vba or .vba.gz extensions. In case you don't remember vimball file name, it is contained into ~/.vim/.VimballRecord file.

In order to avoid this problem in the future, try vim-addon-manager plugin. Like pathogen, it puts each plugin into separate directory, but is also capable of downloading, installing and updating them.

Upvotes: 34

Related Questions