diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 37fee04..adef801 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -3,7 +3,7 @@ func! vundle#config#bundle(arg, ...) call extend(bundle, copy(s:bundle)) call add(g:bundles, bundle) call s:rtp_add(bundle.rtpath()) - call s:require(bundle) + call vundle#config#require(bundle) endf func! vundle#config#init() @@ -11,6 +11,14 @@ func! vundle#config#init() let g:bundles = [] endf +func! vundle#config#require(bundle) + call s:rtp_add(g:bundle_dir) + " TODO: it has to be relative rtpath, not bundle, name + exec 'runtime! '.a:bundle.name.'/plugin/*.vim' + exec 'runtime! '.a:bundle.name.'/after/*.vim' + call s:rtp_rm(g:bundle_dir) +endf + func! s:parse_options(opts) " TODO: improve this if len(a:opts) != 1 | return {} | endif @@ -34,14 +42,6 @@ func! s:parse_name(arg) return {'name': name, 'uri': uri } endf -func! s:require(bundle) - call s:rtp_add(g:bundle_dir) - " TODO: it has to be relative rtpath, not bundle, name - exec 'runtime! '.a:bundle.name.'/plugin/*.vim' - exec 'runtime! '.a:bundle.name.'/after/*.vim' - call s:rtp_rm(g:bundle_dir) -endf - func! s:rtp_rm(dir) exec 'set rtp-='.a:dir exec 'set rtp-='.expand(a:dir.'/after') diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 1a6034e..d5f221a 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -33,7 +33,8 @@ endf func! s:install(bang, bundle) let synced = s:sync(a:bang, a:bundle) call s:helptags(a:bundle.rtpath()) - call s:log(a:bundle.name.' '.(synced ? ' ': ' already').' installed') + call s:log(a:bundle.name.' '.(synced ? '': ' already').' installed') + if synced | call vundle#config#require(a:bundle) | endif endf func! s:log(msg)