Temporarily disable some plugins using pathogen in vim.

PluginsVim

Plugins Problem Overview


I think I have a bug in one plugin. I would like to load only this plugin, without having to delete all the other bundles in my pathogen's bundle folder, to debug.

Is it possible?

Plugins Solutions


Solution 1 - Plugins

The easiest method to disable a plugin when you use Pathogen is by adding it's bundle name to the g:pathogen_disabled variable, before starting pathogen.

So an example from my own vimrc

" To disable a plugin, add it's bundle name to the following list
let g:pathogen_disabled = []

" for some reason the csscolor plugin is very slow when run on the terminal
" but not in GVim, so disable it if no GUI is running
if !has('gui_running')
    call add(g:pathogen_disabled, 'csscolor')
endif

" Gundo requires at least vim 7.3
if v:version < '703' || !has('python')
    call add(g:pathogen_disabled, 'gundo')
endif

if v:version < '702'
    call add(g:pathogen_disabled, 'autocomplpop')
    call add(g:pathogen_disabled, 'fuzzyfinder')
    call add(g:pathogen_disabled, 'l9')
endif

call pathogen#infect()

Update: Another method, supported by Pathogen, is to simply rename the directory for the bundle you want to disable so that it ends in a tilde (~). So to disable the autocomplpop bundle, simply rename it to autocomplpop~.

Solution 2 - Plugins

vim -u NONE -N will load vim with no plugins, with no settings from your .vimrc. You could then :source /path/to/plugin/you-want.vim inside vim to load the one plugin you want loaded.

Solution 3 - Plugins

vim --noplugin

In this case vim will not load any plugins but your vimrc will be used.

After you can load your plugin in vim:

:source 'your plugin path'

Solution 4 - Plugins

Why not just:

  1. rename the current bundle directory
  2. create a new empty bundle directory
  3. put your test plugin files into the new bundle dir?

When done put everything back the way it was. (The suggested method of loading Vim without plugins and sourcing the plugin file would work if it's a simple one-file plugin, but if you're doing an ftplugin then moving dirs around is probably best way and not that hard.)

Solution 5 - Plugins

You could rename the specific plugin by putting a tilde sign ~ after its original name. Every plugin folders within the bundle with the tilde sign ~ at the end will not be loaded by the pathogen.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSomebody still uses you MS-DOSView Question on Stackoverflow
Solution 1 - PluginsjeroenView Answer on Stackoverflow
Solution 2 - PluginsfrabjousView Answer on Stackoverflow
Solution 3 - PluginsRegiszView Answer on Stackoverflow
Solution 4 - PluginsHerbert SitzView Answer on Stackoverflow
Solution 5 - PluginsRyan WuView Answer on Stackoverflow