" vim -gu test/vimrc
|
|
set nocompatible
|
|
|
|
syntax on
|
|
|
|
silent exec 'e '.expand('<sfile>')
|
|
|
|
let branch = split(filter(split(system('git branch'),'\n'),'v:val[0]=="*"')[0],'\s\+')[1]
|
|
let root = '/tmp/'.branch.'/vundle_bundles'
|
|
"let src = 'http://github.com/gmarik/vundle.git'
|
|
let src = '~/.vim/bundle/vundle/.git'
|
|
|
|
if !isdirectory(expand(root).'/vundle')
|
|
exec '!git clone '.src.' '.root.'/vundle'
|
|
endif
|
|
|
|
runtime macros/matchit.vim
|
|
|
|
exec 'set rtp+='.root.'/vundle'
|
|
|
|
call vundle#rc(root)
|
|
|
|
" Vundle manages Vunlde
|
|
Bundle 'gmarik/vundle'
|
|
|
|
" vim-scripts name
|
|
Bundle 'molokai'
|
|
|
|
" github username with dashes
|
|
Bundle 'vim-scripts/ragtag.vim'
|
|
|
|
" original repo
|
|
Bundle 'altercation/vim-colors-solarized'
|
|
" with extension
|
|
Bundle 'nelstrom/vim-mac-classic-theme.git'
|
|
|
|
" full uri
|
|
Bundle 'https://github.com/vim-scripts/vim-game-of-life'
|
|
" full uri
|
|
Bundle 'git@github.com:gmarik/ingretu.git'
|
|
" short uri
|
|
Bundle 'gh:gmarik/snipmate.vim.git'
|
|
Bundle 'github:mattn/gist-vim.git'
|
|
|
|
" local uri stuff
|
|
Bundle '~/Dropbox/.gitrepos/utilz.vim.git'
|
|
" Bundle 'file://Dropbox/.gitrepos/utilz.vim.git'
|
|
|
|
" with options
|
|
Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'}
|
|
|
|
" Camel case
|
|
Bundle 'vim-scripts/RubySinatra'
|
|
|
|
" PostInstall
|
|
Bundle 'wincent/Command-T'
|
|
|
|
Bundle 'CSS3-Highlights'
|
|
|
|
augroup user#css3-highlights
|
|
au!
|
|
au User BundleInstallPre ! [ -d .git ] && git reset --hard
|
|
au User BundleInstallPost ! vim **/*.vim +'bufdo set fileformat=unix | wall | qall'
|
|
augroup end
|
|
|
|
|
|
" NOSYNC
|
|
" existing directory
|
|
Bundle! root.'/vundle/test/'
|
|
|
|
" just create one
|
|
Bundle! 'a_plugin'
|
|
"
|
|
" just create one, and override name
|
|
Bundle! 'b_plugin', {'name': 'zzz'}
|
|
|
|
filetype plugin indent on " Automatically detect file types.
|
|
|
|
set wildignore+=doc " should not break helptags
|
|
set wildignore+=.git " should not break clone
|
|
|
|
augroup vimrc
|
|
au WinEnter * call Test()
|
|
augroup END
|
|
|
|
func! Test() abort
|
|
if 'ok' != g:vundle_test_plugin()
|
|
throw 'ooops'
|
|
endif
|
|
|
|
call Assert_bundles()
|
|
call Assert_a_bundle()
|
|
call Assert_b_bundle()
|
|
endf
|
|
|
|
func! Assert(cond, msg)
|
|
if !(a:cond)
|
|
throw a:msg
|
|
endif
|
|
endf
|
|
|
|
func! Assert_bundles() abort
|
|
for b in g:vundle#bundles
|
|
call Assert(b.nosync() || b.installed(), b.name.' not installed')
|
|
endfor
|
|
endf
|
|
|
|
func! Assert_a_bundle() abort
|
|
let b = filter(copy(g:vundle#bundles), 'v:val.name == "a_plugin"')[0]
|
|
let c = (b.path() == expand(g:vundle#bundle_dir.'/'.'a_plugin'))
|
|
call Assert(c, b.name.' isnt instaled')
|
|
endf
|
|
|
|
func! Assert_b_bundle() abort
|
|
let b = filter(copy(g:vundle#bundles), 'v:val.name == "zzz"')[0]
|
|
let c = (b.path() == expand(g:vundle#bundle_dir.'/'.'zzz'))
|
|
call Assert(c, b.name.' isnt instaled')
|
|
endf
|
|
|