BundleInstall and BundleInstall!
- BundleInstall installs only not installed scripts - BundleInstall! installs(updates) all scripts
This commit is contained in:
parent
280dbd5f71
commit
a9e235028c
@ -4,7 +4,7 @@
|
|||||||
" Readme: http://github.com/gmarik/vundle/blob/master/README.md
|
" Readme: http://github.com/gmarik/vundle/blob/master/README.md
|
||||||
|
|
||||||
com! -nargs=+ Bundle call vundle#add_bundle(<args>)
|
com! -nargs=+ Bundle call vundle#add_bundle(<args>)
|
||||||
com! -nargs=0 BundleInstall call vundle#install_bundles()
|
com! -nargs=? -bang BundleInstall call vundle#install_bundles("<bang>")
|
||||||
com! -nargs=0 BundleDocs call vundle#helptags()
|
com! -nargs=0 BundleDocs call vundle#helptags()
|
||||||
|
|
||||||
com! -nargs=+ -bang BundleSearch silent call vundle#scripts#search("<bang>", <q-args>)
|
com! -nargs=+ -bang BundleSearch silent call vundle#scripts#search("<bang>", <q-args>)
|
||||||
@ -22,11 +22,13 @@ func! vundle#add_bundle(arg, ...)
|
|||||||
call s:rtp_add(bundle.rtpath())
|
call s:rtp_add(bundle.rtpath())
|
||||||
endf
|
endf
|
||||||
|
|
||||||
func! vundle#install_bundles()
|
func! vundle#install_bundles(bang)
|
||||||
silent source ~/.vimrc
|
silent source ~/.vimrc
|
||||||
exec '!mkdir -p '.g:bundle_dir
|
if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif
|
||||||
for bundle in g:bundles | call s:install(bundle) | endfor
|
for bundle in g:bundles |
|
||||||
echo 'Done'
|
let synced = s:install('!' == a:bang, bundle)
|
||||||
|
echo bundle.name.' '.(synced ? ' ': ' already').' installed'
|
||||||
|
endfor
|
||||||
endf
|
endf
|
||||||
|
|
||||||
func! vundle#helptags()
|
func! vundle#helptags()
|
||||||
@ -73,20 +75,22 @@ func! s:helptags(rtp)
|
|||||||
return 1
|
return 1
|
||||||
endf
|
endf
|
||||||
|
|
||||||
func! s:sync(bundle)
|
func! s:sync(bang, bundle)
|
||||||
let git_dir = a:bundle.path().'/.git'
|
let git_dir = a:bundle.path().'/.git'
|
||||||
if isdirectory(git_dir)
|
if isdirectory(git_dir)
|
||||||
|
if !(a:bang) | return 0 | endif
|
||||||
silent exec '!cd '.a:bundle.path().'; git pull'
|
silent exec '!cd '.a:bundle.path().'; git pull'
|
||||||
else
|
else
|
||||||
silent exec '!git clone '.a:bundle.uri.' '.a:bundle.path()
|
silent exec '!git clone '.a:bundle.uri.' '.a:bundle.path()
|
||||||
endif
|
endif
|
||||||
|
return 1
|
||||||
endf
|
endf
|
||||||
|
|
||||||
func! s:install(bundle)
|
func! s:install(bang, bundle)
|
||||||
echo a:bundle.name
|
if !s:sync(a:bang, a:bundle) | return 0 | end
|
||||||
call s:sync(a:bundle)
|
|
||||||
call s:helptags(a:bundle.rtpath())
|
call s:helptags(a:bundle.rtpath())
|
||||||
exec 'runtime! '.a:bundle.rtpath().'/plugin/*.vim'
|
exec 'runtime! '.a:bundle.rtpath().'/plugin/*.vim'
|
||||||
|
return 1
|
||||||
endf
|
endf
|
||||||
|
|
||||||
let s:bundle = {}
|
let s:bundle = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user