Browse Source

Introduce BundleBind! command to speed up Vim startup

The performance issue was introduced in 55a5ef04.
pull/98/head
Rainux Luo 14 years ago
parent
commit
4391eb3517
4 changed files with 26 additions and 2 deletions
  1. +3
    -0
      autoload/vundle.vim
  2. +5
    -2
      autoload/vundle/config.vim
  3. +11
    -0
      doc/vundle.txt
  4. +7
    -0
      plugin/vundle.vim

+ 3
- 0
autoload/vundle.vim View File

@ -7,6 +7,9 @@
com! -nargs=+ Bundle
\ call vundle#config#bundle(<args>)
com! -nargs=0 -bang BundleBind
\ call vundle#config#bind()
com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall
\ call vundle#installer#new('!' == '<bang>', <q-args>)


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

@ -1,8 +1,11 @@
func! vundle#config#bundle(arg, ...)
let bundle = vundle#config#init_bundle(a:arg, a:000)
call s:rtp_rm_a()
call add(g:bundles, bundle)
call s:rtp_add_a()
endf
func! vundle#config#bind()
call s:rtp_rm_a()
call vundle#config#require(g:bundles)
endf
func! vundle#config#init()


+ 11
- 0
doc/vundle.txt View File

@ -108,6 +108,17 @@ equals full uri >
NOTE: Vundle defaults to http:// protocol for the short URIs
*BundleBind!*
`Bundle` command just tell Vundle which scripts you want to use, it doesn't
tell Vim load them, i.e, it doesn't update the 'runtimepath' option of Vim.
To tell Vim load your scripts, `BundleBind!` must be executed. But Vundle will
do it automatically, so usually you don't need to do it yourself.
The benefit of use an extra command to update 'runtimepath' is, we can make
Vim startup much faster while keeping 'runtimepath' ordered according to the
bundles declarations.
4.2 INSTALL SCRIPTS ~
*vundle-scripts-install* *BundleInstall*


+ 7
- 0
plugin/vundle.vim View File

@ -0,0 +1,7 @@
if exists('g:loaded_vundle') || &cp
finish
endif
let g:loaded_vundle = 1
" Bind and load all scripts bundles immediately.
BundleBind!

Loading…
Cancel
Save