Allow updating specific plugins.

This commit is contained in:
Shahaf Arad
2015-02-16 20:03:37 +02:00
committed by Jacobo de Vera
parent a864467285
commit 1df432aecf
4 changed files with 40 additions and 9 deletions

View File

@@ -6,9 +6,21 @@
" ... -- any number of bundle specifications (separate arguments)
" ---------------------------------------------------------------------------
func! vundle#installer#new(bang, ...) abort
let bundles = (a:1 == '') ?
\ g:bundles :
\ map(copy(a:000), 'vundle#config#bundle(v:val, {})')
" No specific plugins are specified. Operate on all plugins.
if a:0 == 0
let bundles = g:bundles
" Specific plugins are specified for update. Update them.
elseif (a:bang)
let bundles = filter(copy(g:bundles), 'index(a:000, v:val.name) > -1')
" Specific plugins are specified for installation. Install them.
else
let bundles = map(copy(a:000), 'vundle#config#bundle(v:val, {})')
endif
if empty(bundles)
echoerr 'No bundles were selected for operation'
return
endif
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'])

View File

@@ -39,7 +39,12 @@ endf
" candidates, see also :h command-completion-custom
" ---------------------------------------------------------------------------
func! vundle#scripts#complete(a,c,d)
return join(s:load_scripts(0),"\n")
" Return only installed plugins if updating
if match(a:c, '\v^Plugin%(Install!|Update)') == 0
return join(map(copy(g:bundles), 'v:val.name'), "\n")
else
return join(s:load_scripts(0),"\n")
endif
endf