gmarik/vundle — pull request #133 by ralesi (2012-01-29 08:01:10+00:00)
Title: Loading bundles after VimEnter

I have come up with a method to load bundles after startup, using the `BundleLoad` command. `BundleLoad` loads the plugin into the rtp, basically running along the lines of `vundle#installer#install`, but hidden. It then runs a `doautoall BufRead` to refresh all of the open buffers.

I am using this along with an `au FileType` command and a custom dictionary to automatically load packages based on the filetype I am currently using to give the same kind of effect from the unbundle package by @sunaku.

I have also included adjustments to the `BundleClean` package including command line autocomplete of unmanaged plugins, allowing one to run `BundleClean` on an individual package.

An example of my FTBundle capability is as follows:

autocmd FileType * :call FTBundles(expand(''))

fun! s:FTBundles(ftype)
" echom a:ftype
let ftype = a:ftype

let activate = []
for [k,v] in items(g:vundle_plugins)
if (type(ftype) == type('') && ftype == k)
call extend(activate, v)
if match(g:vundle_loaded,k[0]) == -1
let g:vundle_loaded .= k[0]
else
return
endif
endif
endfor
if !empty(activate)
exec 'BundleLoad "'. join(activate,'","').'"'
endif
endf

and my plugin dictionary looks like this:

let g:vundle_plugins = {
\ 'python': ['klen/python-mode'],
\ 'code': ['rson/vim-conque', 'bkad/CamelCaseMotion', 'ciaranm/detectindent', 'tpope/vim-endwise'],
\ 'blog': ['Vimblr', 'bit:pentie/vimrepress'],
\ 'org': [ 'jceb/vim-orgmode', 'tpope/vim-speeddating', 'hsitz/VimOrganizer'],
\ 'ruby': [ 'tpope/vim-ruby'],
\ 'tex': [ 'LaTeX-Box', 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'],
\ 'autohotkey': [ 'autohotkey-ahk'],
\ 'markdown': [ 'tpope/vim-markdown'],
\ 'javascript': [ 'pangloss/vim-javascript'],
\ 'docs': [ 'vim-pandoc/vim-pandoc', 'robgleeson/hammer.vim', 'mikewest/vimroom']
\ }