Lazy loading plugins with begin/end block
This commit is contained in:
parent
6545681f56
commit
c20c90d867
@ -64,3 +64,13 @@ func! vundle#rc(...) abort
|
|||||||
let g:vundle_changelog = ['Updated Plugins:']
|
let g:vundle_changelog = ['Updated Plugins:']
|
||||||
call vundle#config#init()
|
call vundle#config#init()
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
func! vundle#begin(...) abort
|
||||||
|
let g:vundle_lazy_load = 1
|
||||||
|
call call('vundle#rc', a:000)
|
||||||
|
endf
|
||||||
|
|
||||||
|
func! vundle#end(...) abort
|
||||||
|
unlet g:vundle_lazy_load
|
||||||
|
call vundle#config#activate_bundles()
|
||||||
|
endf
|
||||||
|
@ -1,11 +1,19 @@
|
|||||||
func! vundle#config#bundle(arg, ...)
|
func! vundle#config#bundle(arg, ...)
|
||||||
let bundle = vundle#config#init_bundle(a:arg, a:000)
|
let bundle = vundle#config#init_bundle(a:arg, a:000)
|
||||||
|
if exists('g:vundle_lazy_load') && g:vundle_lazy_load
|
||||||
|
call add(g:bundles, bundle)
|
||||||
|
else
|
||||||
call s:rtp_rm_a()
|
call s:rtp_rm_a()
|
||||||
call add(g:bundles, bundle)
|
call add(g:bundles, bundle)
|
||||||
call s:rtp_add_a()
|
call s:rtp_add_a()
|
||||||
|
endif
|
||||||
return bundle
|
return bundle
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
func! vundle#config#activate_bundles()
|
||||||
|
call s:rtp_add_a()
|
||||||
|
endf
|
||||||
|
|
||||||
func! vundle#config#init()
|
func! vundle#config#init()
|
||||||
if !exists('g:bundles') | let g:bundles = [] | endif
|
if !exists('g:bundles') | let g:bundles = [] | endif
|
||||||
call s:rtp_rm_a()
|
call s:rtp_rm_a()
|
||||||
|
Loading…
Reference in New Issue
Block a user