Browse Source

Add support to install script into a specific directory.

pull/200/head
Techlive Zheng 14 years ago
parent
commit
d19ce012ff
3 changed files with 16 additions and 4 deletions
  1. +6
    -1
      autoload/vundle/config.vim
  2. +2
    -1
      autoload/vundle/installer.vim
  3. +8
    -2
      doc/vundle.txt

+ 6
- 1
autoload/vundle/config.vim View File

@ -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

+ 2
- 1
autoload/vundle/installer.vim View File

@ -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


+ 8
- 2
doc/vundle.txt View File

@ -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'


Loading…
Cancel
Save