How to disable vim system global plugin?

684 views
Skip to first unread message

Sean

unread,
Jan 21, 2009, 7:05:55 PM1/21/09
to vim_use
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

Matt Wozniski

unread,
Jan 21, 2009, 9:14:17 PM1/21/09
to vim...@googlegroups.com
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

Sean

unread,
Jan 23, 2009, 11:14:08 PM1/23/09
to vim_use
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
Reply all
Reply to author
Forward
0 new messages