From d19ce012ff45436bf3819d5926cf803fbd50ee99 Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Mon, 6 Aug 2012 11:21:31 +0800 Subject: [PATCH] Add support to install script into a specific directory. --- autoload/vundle/config.vim | 7 ++++++- autoload/vundle/installer.vim | 3 ++- doc/vundle.txt | 10 ++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 55c7d7d0..a2ff68d9 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -101,6 +101,11 @@ endf let s:bundle = {} func! s:bundle.path() - return s:expand_path(g:bundle_dir.'/'.self.name) + if exists('self.dir') + let dir = self.dir + else + let dir = self.name + endif + return s:expand_path(g:bundle_dir.'/'.dir) endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 036a756f..d94fb770 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -100,7 +100,8 @@ 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 n = substitute(a:name,"['".'"]\+','','g') + let b = filter(copy(g:bundles), 'v:val.name_spec == n')[0] return s:sync(a:bang, b) endf diff --git a/doc/vundle.txt b/doc/vundle.txt index 57e7260b..4878f559 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -64,8 +64,8 @@ in order to install/search [all available vim scripts] " My Bundles here: " " original repos on github - Bundle 'tpope/vim-fugitive' - Bundle 'Lokaltog/vim-easymotion' + Bundle 'tpope/vim-fugitive', {'dir': 'plugin-fugitive'} + Bundle 'Lokaltog/vim-easymotion', {'dir': 'plugin-easymotion'} Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} " vim-scripts repos Bundle 'L9' @@ -99,6 +99,12 @@ command in `.vimrc`: > or > Bundle 'script_name' " 'script-name' should be an official script name (see |vundle-scripts-search| ) +If you want install script into a specific directory under bundle, a dictionary +contains the desired directory name with key 'dir' could be appended to the +`Bundle` command. + + Bundle 'git_repo_uri', {'dir':'install_dir'} " the script will be installed at 'bundle/install_dir' + Vundle loves Github, that's why short uris can be used with commands: > Bundle 'tpope/vim-fugitive'