From 822a14cb9d396681357d1e47b73f1aec50cdbabe Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Thu, 21 Jun 2012 10:45:28 -0500 Subject: [PATCH 1/3] allow options to override defaults in Bundle call changed order of dictionaries in a call to extend that lets user options passed as a dictionary to the Bundle command override default parameters obtained by parsing the repository url. --- autoload/vundle/config.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 55c7d7d..e28b61e 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -24,7 +24,7 @@ func! vundle#config#require(bundles) abort endf func! vundle#config#init_bundle(name, opts) - let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g'))) + let opts = extend(s:parse_name(substitute(a:name,"['".'"]\+','','g')), s:parse_options(a:opts)) let b = extend(opts, copy(s:bundle)) let b.rtpath = s:rtpath(opts) return b From 165d398a1ab541d43133ae9a52d8da4a45e0fd6a Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Thu, 21 Jun 2012 20:35:20 -0500 Subject: [PATCH 2/3] added documentation for Bundle options to docs Added a section on passing options to the Bundle command. --- doc/vundle.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/vundle.txt b/doc/vundle.txt index 57e7260..0d09349 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -79,6 +79,18 @@ in order to install/search [all available vim scripts] " or " filetype plugin on " to not use the indentation settings set by plugins + Options + + Options can specified by passing a dictionary to the second argument of the Bundle command. In the + example above, the 'rtp' option, which specifies the directory that a bundles runtime files are located + in relative to the bundle's top directory, is passed to the 'rstacruz/sparkup' bundle. Options can be + used to override the default parameters that are extracted from the bundle name. Note, multiple options + are passed through a *single* dictionary. Options that can be set: + + rtp : The directory (relative to the bundle's main directory) that contains the plugin's runtime files. + uri : The bundle's uri for a 'git clone'. This can be used to specify a ssh:// uri, which vundle does not support directly + name : The bundle's name, the bundle will be cloned into a subdirectory of the bundle directory with this name + 3) Install configured bundles: Launch `vim`, run > From d820c25dc895afb0b2d6b241081fab67a9604886 Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Thu, 21 Jun 2012 23:17:49 -0500 Subject: [PATCH 3/3] allow install functions to use bundle configs edited the vundle#installer#install function to lookup (and use) the configuration specified by the users Bundle commands. --- autoload/vundle/installer.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 38a2436..ea20a66 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -100,7 +100,15 @@ endf func! vundle#installer#install(bang, name) abort if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif - let b = vundle#config#init_bundle(a:name, {}) + "let b = vundle#config#init_bundle(a:name, {}) + "we've already initialized all these bundles. + "we just need to find the one we that corresponds to a:name + for bb in g:bundles + if ( bb.name_spec == substitute(a:name,"['".'"]\+','','g') ) + let b = bb + break + endif + endfor return s:sync(a:bang, b) endf