From cb190b65fe791c8eee36e7b8d73ef515ec4b832c Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Wed, 6 Mar 2013 04:57:26 +0000 Subject: [PATCH] Added function to install bundle only if vim version matches --- autoload/vundle.vim | 4 ++++ autoload/vundle/config.vim | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 0bc7bf5..7d6e958 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -7,6 +7,10 @@ com! -nargs=+ Bundle \ call vundle#config#bundle() +com! -nargs=+ BundleIf +\ call vundle#config#bundle_if() + + com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall \ call vundle#installer#new('!' == '', ) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index f629ea4..5a1e8ee 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -6,6 +6,15 @@ func! vundle#config#bundle(arg, ...) return bundle endf +func! vundle#config#bundle_if(arg, ...) + let versions = split(a:arg, '\.') + if v:version == versions[0] && has(join(['patch',versions[1]],'')) + echom 'installing bundle' + echom join(a:000) + call vundle#config#bundle(join(a:000)) + endif +endf + func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a()