diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 7bcf647..b2c5e98 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -6,6 +6,13 @@ func! vundle#config#bundle(arg, ...) return bundle endf +func! vundle#config#unbundle(arg, ...) + let g:aabundle = vundle#config#init_bundle(a:arg, a:000) + let g:name=g:aabundle.name_spec + let g:unbundle=vundle#installer#get_bundle_dir(g:bundles, g:name) +endf + + func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a() @@ -16,9 +23,9 @@ func! vundle#config#require(bundles) abort for b in a:bundles call s:rtp_add(b.rtpath) call s:rtp_add(g:bundle_dir) - " TODO: it has to be relative rtpath, not bundle.name - exec 'runtime! '.b.name.'/plugin/*.vim' - exec 'runtime! '.b.name.'/after/*.vim' + " Use absolute rtpath + exec 'runtime! '.b.rtpath.'/plugin/*.vim' + exec 'runtime! '.b.rtpath.'/after/*.vim' call s:rtp_rm(g:bundle_dir) endfor endf @@ -34,13 +41,14 @@ func! vundle#config#init_bundle(name, opts) endf func! s:parse_options(opts) - " TODO: improve this - if len(a:opts) != 1 | return {} | endif + if type(a:opts) == type({}) + return a:opts + endif - if type(a:opts[0]) == type({}) - return a:opts[0] - else - return {'rev': a:opts[0]} + if type(a:opts) == type([]) && len(a:opts) == 1 + return type(a:opts[0]) == type({}) ? a:opts[0] : {'rev':a:opts[0]} + else + return {} endif endf @@ -104,6 +112,7 @@ endf let s:bundle = {} func! s:bundle.path() - return s:expand_path(g:bundle_dir.'/'.self.name) + let a:bundle_dir = has_key(self, "bundle_dir") ? self.bundle_dir : g:bundle_dir + return s:expand_path(a:bundle_dir.'/'.self.name) endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 7fdc5f3..a16ea39 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -4,7 +4,7 @@ func! vundle#installer#new(bang, ...) abort \ map(copy(a:000), 'vundle#config#bundle(v:val, {})') let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) - call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags']) + call vundle#scripts#view('Installer',['" Installing bundles to '.expand(g:bundle_dir, 1)], names + ['Helptags']) call s:process(a:bang, (a:bang ? 'add!' : 'add')) @@ -30,7 +30,7 @@ func! s:process(bang, cmd) endif if 'updated' == g:vundle_last_status && empty(msg) - let msg = 'Plugins updated; press u to view changelog' + let msg = 'Bundles updated; press u to view changelog' endif " goto next one @@ -81,7 +81,7 @@ func! vundle#installer#run(func_name, name, ...) abort return status endf -func! s:sign(status) +func! s:sign(status) if (!has('signs')) return endif