This commit is contained in:
gmarik 2010-10-17 19:46:09 -05:00
parent b6d413179a
commit a9cc9f7933

View File

@ -7,22 +7,22 @@
if exists("g:vundle_loaded") || &cp | finish | endif if exists("g:vundle_loaded") || &cp | finish | endif
let g:vundle_loaded = 1 let g:vundle_loaded = 1
com! -nargs=+ Bundle call g:BundleAdd(<args>) com! -nargs=+ Bundle call vundle#add_bundle(<args>)
com! -nargs=0 BundleRequire call g:BundleRequire() com! -nargs=0 BundleRequire call vundle#require_bundles()
com! -nargs=0 BundleSync call g:BundleSync() com! -nargs=0 BundleSync call vundle#sync_bundles()
com! -nargs=0 BundleInstall call g:BundleInstall() com! -nargs=0 BundleInstall call vundle#install_bundles()
let g:bundle_dir = expand('~/.vim/bundle/') let g:bundle_dir = expand('~/.vim/bundle/')
let g:bundles = [] let g:bundles = []
let g:bundle_uris = {} let g:bundle_uris = {}
function! g:BundleAdd(...) function! vundle#add_bundle(...)
let bundle = split(a:1,'\/')[-1] let bundle = split(a:1,'\/')[-1]
call add(g:bundles, bundle) call add(g:bundles, bundle)
let g:bundle_uris[bundle] = a:1 let g:bundle_uris[bundle] = a:1
endfunction endfunction
function! g:BundleRequire() function! vundle#require_bundles()
let rtp = filter(split(&rtp, ','),'v:val !~# g:bundle_dir') let rtp = filter(split(&rtp, ','),'v:val !~# g:bundle_dir')
let after = [] | let before = [] let after = [] | let before = []
for bundle in g:bundles for bundle in g:bundles
@ -32,12 +32,12 @@ function! g:BundleRequire()
let &rtp = join(before + rtp + after, ',') let &rtp = join(before + rtp + after, ',')
endfunction endfunction
function! g:BundleInstall() function! vundle#install_bundles()
call g:BundleSync() call g:sync_bundles()
call g:BundleHelptags() call g:helptagify_bundles()
endfunction endfunction
function! g:BundleSync() function! vundle#sync_bundles()
execute '!mkdir -p '.g:bundle_dir execute '!mkdir -p '.g:bundle_dir
for bundle in g:bundles for bundle in g:bundles
let bundle_path = s:BundlePath(bundle) let bundle_path = s:BundlePath(bundle)
@ -46,7 +46,7 @@ function! g:BundleSync()
endfor endfor
endfunction endfunction
function! g:BundleHelptags() function! g:helptagify_bundles()
for bundle in g:bundles for bundle in g:bundles
let dir = s:BundlePath(bundle) let dir = s:BundlePath(bundle)
if isdirectory(dir.'/doc') && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags')) if isdirectory(dir.'/doc') && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))