diff --git a/README.md b/README.md index 95c5ec0..9d2bbd8 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,10 @@ Plugin 'Lokaltog/vim-easymotion' Plugin 'tpope/vim-rails.git' " The sparkup vim script is in a subdirectory of this repo called vim. - " Pass the path to set the runtimepath properly. + " Pass the path to set the runtimepath inside the repo properly. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " Pass the path to set the plugin's runtimepath dir. + Plugin 'joonty/vim-sauce', {'bundle_dir' : '~/plugin_dir/'} " scripts from http://vim-scripts.org/vim/scripts.html Plugin 'L9' Plugin 'FuzzyFinder' diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 7bcf647..0d7685f 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -16,9 +16,9 @@ func! vundle#config#require(bundles) abort for b in a:bundles call s:rtp_add(b.rtpath) call s:rtp_add(g:bundle_dir) - " TODO: it has to be relative rtpath, not bundle.name - exec 'runtime! '.b.name.'/plugin/*.vim' - exec 'runtime! '.b.name.'/after/*.vim' + " Use absolute rtpath + exec 'runtime! '.b.rtpath.'/plugin/*.vim' + exec 'runtime! '.b.rtpath.'/after/*.vim' call s:rtp_rm(g:bundle_dir) endfor endf @@ -34,13 +34,14 @@ func! vundle#config#init_bundle(name, opts) endf func! s:parse_options(opts) - " TODO: improve this - if len(a:opts) != 1 | return {} | endif + if type(a:opts) == type({}) + return a:opts + endif - if type(a:opts[0]) == type({}) - return a:opts[0] - else - return {'rev': a:opts[0]} + if type(a:opts) == type([]) && len(a:opts) == 1 + return type(a:opts[0]) == type({}) ? a:opts[0] : {'rev':a:opts[0]} + else + return {} endif endf @@ -104,6 +105,7 @@ endf let s:bundle = {} func! s:bundle.path() - return s:expand_path(g:bundle_dir.'/'.self.name) + let a:bundle_dir = has_key(self, "bundle_dir") ? self.bundle_dir : g:bundle_dir + return s:expand_path(a:bundle_dir.'/'.self.name) endf diff --git a/test/vimrc b/test/vimrc index 13dd2e2..1972b1d 100644 --- a/test/vimrc +++ b/test/vimrc @@ -51,6 +51,7 @@ Bundle '~/Dropbox/.gitrepos/utilz.vim.git' " with options Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'} Bundle 'matchit.zip', {'name': 'matchit'} +Plugin 'joonty/vim-sauce', {'bundle_dir' : '~/.vim/custom_bundle/'} " Camel case Bundle 'vim-scripts/RubySinatra'