Browse Source

Preserve `rtp` ordered according to Bundle declarations

- fixes https://github.com/gmarik/vundle/issues#issue/3
- TODO: not the most efficient approach
events
gmarik 14 years ago
parent
commit
55a5ef041c
2 changed files with 12 additions and 4 deletions
  1. +0
    -2
      autoload/vundle.vim
  2. +12
    -2
      autoload/vundle/config.vim

+ 0
- 2
autoload/vundle.vim View File

@ -10,8 +10,6 @@ com! -nargs=0 BundleDocs call vundle#installer#helptags()
com! -nargs=+ -bang BundleSearch silent call vundle#scripts#search("<bang>", <q-args>)
if !exists('g:bundles') | let g:bundles = [] | endif
func! vundle#rc()
let g:bundle_dir = expand('$HOME/.vim/bundle')
call vundle#config#init()


+ 12
- 2
autoload/vundle/config.vim View File

@ -1,14 +1,16 @@
func! vundle#config#bundle(arg, ...)
let bundle = extend(s:parse_options(a:000), s:parse_name(a:arg))
call extend(bundle, copy(s:bundle))
call s:rtp_rm_a()
call add(g:bundles, bundle)
call s:rtp_add(bundle.rtpath())
call s:rtp_add_a()
" TODO: fix this: explicit sourcing kills command-T
" call vundle#config#require(bundle)
endf
func! vundle#config#init()
call filter(g:bundles, 's:rtp_rm(v:val.rtpath())')
if !exists('g:bundles') | let g:bundles = [] | endif
call s:rtp_rm_a()
let g:bundles = []
endf
@ -43,6 +45,14 @@ func! s:parse_name(arg)
return {'name': name, 'uri': uri }
endf
func! s:rtp_rm_a()
for b in g:bundles | call s:rtp_rm(b.rtpath()) | endfor
endf
func! s:rtp_add_a()
for b in reverse(copy(g:bundles)) | call s:rtp_add(b.rtpath()) | endfor
endf
func! s:rtp_rm(dir)
exec 'set rtp-='.a:dir
exec 'set rtp-='.expand(a:dir.'/after')


|||||||
x
 
000:0
Loading…
Cancel
Save