diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 34ac229..93385c5 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -17,7 +17,7 @@ com! -nargs=? -bang BundleClean \ call vundle#installer#clean('!' == '') com! -nargs=0 BundleDocs -\ call vundle#installer#helptags(g:bundles) +\ call vundle#installer#helptags(g:vundle#bundles) " deprecated in favor of Bundles com! -nargs=? -bang BundleSearch @@ -29,6 +29,6 @@ au Syntax vim syn keyword vimCommand Bundle func! vundle#rc(...) abort - let g:bundle_dir = len(a:000) > 0 ? expand(a:1) : expand('$HOME/.vim/bundle') + let g:vundle#bundle_dir = len(a:000) > 0 ? expand(a:1) : expand('$HOME/.vim/bundle') call vundle#config#init() endf diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 9d49dbf..9d761ee 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -1,24 +1,24 @@ func! vundle#config#bundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) call s:rtp_rm_a() - call add(g:bundles, bundle) + call add(g:vundle#bundles, bundle) call s:rtp_add_a() endf func! vundle#config#init() - if !exists('g:bundles') | let g:bundles = [] | endif + if !exists('g:vundle#bundles') | let g:vundle#bundles = [] | endif call s:rtp_rm_a() - let g:bundles = [] + let g:vundle#bundles = [] endf func! vundle#config#require(bundles) abort for b in a:bundles call s:rtp_add(b.rtpath()) - call s:rtp_add(g:bundle_dir) + call s:rtp_add(g:vundle#bundle_dir) " TODO: it has to be relative rtpath, not bundle.name exec 'runtime! '.b.name.'/plugin/*.vim' exec 'runtime! '.b.name.'/after/*.vim' - call s:rtp_rm(g:bundle_dir) + call s:rtp_rm(g:vundle#bundle_dir) endfor endf @@ -57,11 +57,11 @@ func! s:parse_name(arg) endf func! s:rtp_rm_a() - call filter(copy(g:bundles), 's:rtp_rm(v:val.rtpath())') + call filter(copy(g:vundle#bundles), 's:rtp_rm(v:val.rtpath())') endf func! s:rtp_add_a() - call filter(reverse(copy(g:bundles)), 's:rtp_add(v:val.rtpath())') + call filter(reverse(copy(g:vundle#bundles)), 's:rtp_add(v:val.rtpath())') endf func! s:rtp_rm(dir) abort @@ -77,7 +77,7 @@ endf let s:bundle = {} func! s:bundle.path() - return join([g:bundle_dir, self.name], '/') + return join([g:vundle#bundle_dir, self.name], '/') endf func! s:bundle.rtpath() diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index e0fbdda..f54a87a 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -1,5 +1,5 @@ func! vundle#installer#install(bang, ...) abort - if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif + if !isdirectory(g:vundle#bundle_dir) | call mkdir(g:vundle#bundle_dir, 'p') | endif let bundles = (a:1 == '') ? \ s:reload_bundles() : \ map(copy(a:000), 'vundle#config#init_bundle(v:val, {})') @@ -27,8 +27,8 @@ func! vundle#installer#helptags(bundles) abort endf func! vundle#installer#clean(bang) abort - let bundle_dirs = map(copy(g:bundles), 'v:val.path()') - let all_dirs = split(globpath(g:bundle_dir, '*'), "\n") + let bundle_dirs = map(copy(g:vundle#bundles), 'v:val.path()') + let all_dirs = split(globpath(g:vundle#bundle_dir, '*'), "\n") let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)') if empty(x_dirs) @@ -48,7 +48,7 @@ func! s:reload_bundles() " TODO: obtain Bundles without sourcing .vimrc if filereadable($MYVIMRC)| silent source $MYVIMRC | endif if filereadable($MYGVIMRC)| silent source $MYGVIMRC | endif - return g:bundles + return g:vundle#bundles endf func! s:has_doc(rtp) abort diff --git a/test/vimrc b/test/vimrc index 172679e..8f78c53 100644 --- a/test/vimrc +++ b/test/vimrc @@ -43,7 +43,7 @@ set wildignore+=doc " should not break helptags BundleInstall func! s:assert_bundles() abort - for b in g:bundles + for b in g:vundle#bundles if (!isdirectory(b.path().'/.git')) throw b.name.' not installed' endif