extracted require function

This commit is contained in:
gmarik 2010-12-08 21:36:53 -06:00
parent 8955c848cb
commit 7183003b26

View File

@ -14,7 +14,6 @@ if !exists('g:bundles') | let g:bundles = [] | endif
func! vundle#rc()
let g:bundle_dir = expand('$HOME/.vim/bundle')
call filter(g:bundles, 's:rtp_rm(v:val.rtpath())')
call s:rtp_rm(g:bundle_dir)
let g:bundles = []
endf
@ -23,8 +22,7 @@ func! vundle#add_bundle(arg, ...)
call extend(bundle, copy(s:bundle))
call add(g:bundles, bundle)
call s:rtp_add(bundle.rtpath())
call s:rtp_add(g:bundle_dir)
exec 'runtime! '.bundle.name.'/plugin/*.vim'
call s:require(bundle)
endf
func! vundle#install_bundles(bang)
@ -62,6 +60,13 @@ func! s:parse_name(arg)
return {'name': name, 'uri': uri }
endf
func! s:require(bundle)
call s:rtp_add(g:bundle_dir)
exec 'runtime! '.a:bundle.name.'/plugin/*.vim'
exec 'runtime! '.a:bundle.name.'/after/*.vim'
call s:rtp_rm(g:bundle_dir)
endf
func! s:helptags(rtp)
if !(isdirectory(a:rtp.'/doc') && (!filereadable(a:rtp.'/doc/tags') || filewritable(a:rtp.'/doc/tags')))
return 0