How to disable vim system global plugin?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to disable vim system global plugin?

Sean-130

Hi,

Is it possible to ignore the existence of the system global plugin
directory?

I know we can set "noloadplugins", but I want to enable ftplugin and
indent plugin.

For example: I found the following scripts were loaded whenever I open
vim:

  9: C:/usr/share/vim/vim72/runtime/plugin/getscriptPlugin.vim
 10: C:/usr/share/vim/vim72/runtime/plugin/gzip.vim
 11: C:/usr/share/vim/vim72/runtime/plugin/matchparen.vim
 12: C:/usr/share/vim/vim72/runtime/plugin/netrwPlugin.vim
 13: C:/usr/share/vim/vim72/runtime/plugin/rrhelper.vim
 14: C:/usr/share/vim/vim72/runtime/plugin/spellfile.vim
 15: C:/usr/share/vim/vim72/runtime/plugin/tarPlugin.vim
 16: C:/usr/share/vim/vim72/runtime/plugin/tohtml.vim
 17: C:/usr/share/vim/vim72/runtime/plugin/vimballPlugin.vim
 18: C:/usr/share/vim/vim72/runtime/plugin/zipPlugin.vim

My workaround is to set the following variables in my .vimrc:

let g:netrw_silent=1
let g:loaded_rrhelper=1
let g:loaded_gzip=1
let g:loaded_getscriptPlugin=1
let g:loaded_vimballPlugin=1
let g:loaded_netrwPlugin=1
let g:loaded_zipPlugin=1
let g:loaded_tarPlugin=1
let g:netrw_use_noswf= 0

I am wondering if there is better way to do it?

Thanks

Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: How to disable vim system global plugin?

Matt Wozniski-2

On 1/21/09, Sean wrote:
>
>  Hi,
>
>  Is it possible to ignore the existence of the system global plugin
>  directory?
>
>  I know we can set "noloadplugins", but I want to enable ftplugin and
>  indent plugin.

The 'loadplugins' option (and the equivalent --noplugin command line
switch) only stops regular plugins from loading, not indent scripts or
filetype plugins.

>  For example: I found the following scripts were loaded whenever I open
>  vim:

Doesn't happen for me when I launch with a .vimrc with :set
noloadplugins, or with vim --noplugin.

>  I am wondering if there is better way to do it?

But, note that this will also stop plugins in directories other than
the system directory from running...  if you still want to use the
plugins in ~/.vim, you'll either want to remove the systemwide paths
from 'runtimepath' then do "runtime! plugin/**/*.vim" and restore the
old value of 'runtimepath' - or some such.

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: How to disable vim system global plugin?

Sean-130



On Jan 21, 6:14 pm, Matt Wozniski <[hidden email]> wrote:

> On 1/21/09, Sean wrote:
>
> >  Hi,
>
> >  Is it possible to ignore the existence of the system global plugin
> >  directory?
>
> >  I know we can set "noloadplugins", but I want to enable ftplugin and
> >  indent plugin.
>
> The 'loadplugins' option (and the equivalent --noplugin command line
> switch) only stops regular plugins from loading, not indent scripts or
> filetype plugins.
>
> >  For example: I found the following scripts were loaded whenever I open
> >  vim:
>
> Doesn't happen for me when I launch with a .vimrc with :set
> noloadplugins, or with vim --noplugin.
>
> >  I am wondering if there is better way to do it?
>
> But, note that this will also stop plugins in directories other than
> the system directory from running...  if you still want to use the
> plugins in ~/.vim, you'll either want to remove the systemwide paths
> from 'runtimepath' then do "runtime! plugin/**/*.vim" and restore the
> old value of 'runtimepath' - or some such.
>
> ~Matt

Great. This solution worked for me:

set runtimepath=$VIM/vimfiles
runtime! plugin/*.vim
set runtimepath=$VIM/vimfiles,$VIMRUNTIME

Now, I am able to control which plugin to use.

Thanks

Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---