Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to install script into a specific directory. #200

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion autoload/vundle/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

3 changes: 2 additions & 1 deletion autoload/vundle/installer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions doc/vundle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down