Complete installed plugins also for VundleUpdate

This commit is contained in:
Jacobo de Vera 2015-03-02 22:02:44 +01:00
parent 1df432aecf
commit 92a66df592
2 changed files with 6 additions and 3 deletions

View File

@ -32,6 +32,7 @@ com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch Plugi
com! -nargs=? -bang VundleClean PluginClean<bang>
com! -nargs=0 VundleDocs PluginDocs
com! VundleUpdate PluginInstall!
com! -nargs=* -complete=custom,vundle#scripts#complete VundleUpdate PluginInstall! <args>
" Deprecated Commands
com! -nargs=+ Bundle call vundle#config#bundle(<args>)

View File

@ -36,13 +36,15 @@ endf
"
" a, c, d -- see :h command-completion-custom
" return -- all valid plugin names from vim-scripts.org as completion
" candidates, see also :h command-completion-custom
" candidates, or all installed plugin names when running an 'Update
" variant'. see also :h command-completion-custom
" ---------------------------------------------------------------------------
func! vundle#scripts#complete(a,c,d)
" Return only installed plugins if updating
if match(a:c, '\v^Plugin%(Install!|Update)') == 0
if match(a:c, '\v^%(Plugin|Vundle)%(Install!|Update)') == 0
" Only installed plugins if updating
return join(map(copy(g:bundles), 'v:val.name'), "\n")
else
" Or all known plugins otherwise
return join(s:load_scripts(0),"\n")
endif
endf