2014-02-11 10:09:24 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd $(dirname $BASH_SOURCE)
|
|
|
|
cd ..
|
|
|
|
PLUG_SRC=$(pwd)/plug.vim
|
|
|
|
cd - > /dev/null
|
|
|
|
|
2014-10-18 22:45:19 -07:00
|
|
|
export PLUG_FIXTURES=$(pwd)/fixtures
|
|
|
|
|
2015-01-07 04:14:48 -07:00
|
|
|
clone() {
|
|
|
|
if [ ! -d $2 ]; then
|
|
|
|
git clone $1 $2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Clone
|
|
|
|
cd /tmp
|
|
|
|
mkdir -p junegunn vim-scripts jg
|
|
|
|
for repo in vader.vim goyo.vim rust.vim seoul256.vim vim-easy-align vim-fnr \
|
|
|
|
vim-oblique vim-pseudocl vim-redis vim-emoji; do
|
|
|
|
clone https://github.com/junegunn/${repo}.git junegunn/$repo &
|
|
|
|
done
|
|
|
|
clone https://github.com/vim-scripts/beauty256.git vim-scripts/beauty256 &
|
2014-02-11 10:09:24 -07:00
|
|
|
|
2014-10-18 22:45:19 -07:00
|
|
|
rm -rf $PLUG_FIXTURES/fzf
|
2015-01-07 04:14:48 -07:00
|
|
|
clone https://github.com/junegunn/fzf.git $PLUG_FIXTURES/fzf-staged &
|
|
|
|
wait
|
|
|
|
|
|
|
|
(cd junegunn/seoul256.vim &&
|
|
|
|
git checkout no-t_co && git checkout master) > /dev/null 2>&1
|
|
|
|
clone junegunn/vim-emoji jg/vim-emoji
|
|
|
|
cd - > /dev/null
|
2014-07-16 03:52:58 -07:00
|
|
|
|
2014-07-31 00:34:41 -07:00
|
|
|
make_dirs() {
|
2014-10-18 22:45:19 -07:00
|
|
|
mkdir -p "$PLUG_FIXTURES/$1"
|
|
|
|
cd "$PLUG_FIXTURES/$1"
|
2014-07-31 00:34:41 -07:00
|
|
|
mkdir -p autoload colors ftdetect ftplugin indent plugin syntax
|
|
|
|
for d in *; do
|
2014-09-22 08:21:48 -07:00
|
|
|
[ -d $d ] || continue
|
2014-07-31 00:34:41 -07:00
|
|
|
cat > $d/xxx.vim << EOF
|
|
|
|
" echom expand('<sfile>')
|
2014-09-22 08:21:48 -07:00
|
|
|
let g:total_order = get(g:, 'total_order', [])
|
2014-08-09 21:08:48 -07:00
|
|
|
let g:$2 = get(g:, '$2', [])
|
2014-09-22 08:21:48 -07:00
|
|
|
let s:name = join(filter(['$2', '${1:4}', '$d'], '!empty(v:val)'), '/')
|
|
|
|
call add(g:$2, s:name)
|
|
|
|
call add(g:total_order, s:name)
|
2014-07-31 00:34:41 -07:00
|
|
|
EOF
|
|
|
|
done
|
|
|
|
cd - > /dev/null
|
|
|
|
}
|
|
|
|
|
2014-09-26 23:19:11 -07:00
|
|
|
init() {
|
2014-10-18 22:45:19 -07:00
|
|
|
rm -rf $PLUG_FIXTURES/{xxx,yyy,z1,z2}
|
2015-01-08 07:21:32 -07:00
|
|
|
rm -rf $TMPDIR/new-branch
|
2014-09-26 23:19:11 -07:00
|
|
|
|
|
|
|
make_dirs xxx/ xxx
|
|
|
|
make_dirs xxx/after xxx
|
2014-10-18 22:45:19 -07:00
|
|
|
mkdir -p $PLUG_FIXTURES/xxx/doc
|
|
|
|
cat > $PLUG_FIXTURES/xxx/doc/xxx.txt << DOC
|
2014-08-08 20:02:03 -07:00
|
|
|
hello *xxx*
|
|
|
|
DOC
|
2014-07-31 00:34:41 -07:00
|
|
|
|
2014-09-26 23:19:11 -07:00
|
|
|
make_dirs yyy/ yyy
|
|
|
|
make_dirs yyy/after yyy
|
2014-09-22 08:21:48 -07:00
|
|
|
|
2014-09-26 23:19:11 -07:00
|
|
|
make_dirs z1/ z1
|
|
|
|
make_dirs z2/ z2
|
2015-01-08 07:21:32 -07:00
|
|
|
|
|
|
|
(
|
|
|
|
cd $TMPDIR
|
|
|
|
git init new-branch
|
|
|
|
cd new-branch
|
|
|
|
mkdir plugin
|
|
|
|
echo 'let g:foo = 1' > plugin/foo.vim
|
|
|
|
git add plugin/foo.vim
|
|
|
|
git commit -m initial
|
|
|
|
)
|
2014-09-26 23:19:11 -07:00
|
|
|
}
|
2014-08-09 21:08:48 -07:00
|
|
|
|
2014-06-22 20:47:13 -07:00
|
|
|
cat > /tmp/mini-vimrc << VIMRC
|
2015-01-07 04:14:48 -07:00
|
|
|
set rtp+=/tmp/junegunn/vader.vim
|
2014-08-01 07:16:21 -07:00
|
|
|
set shell=/bin/bash
|
2014-02-11 10:09:24 -07:00
|
|
|
source $PLUG_SRC
|
2014-06-22 20:47:13 -07:00
|
|
|
VIMRC
|
|
|
|
|
2014-10-01 09:32:23 -07:00
|
|
|
[ -z "$TMPDIR" ] && export TMPDIR=/tmp/
|
2014-09-26 23:19:11 -07:00
|
|
|
init
|
2014-06-22 20:47:13 -07:00
|
|
|
if [ "$1" = '!' ]; then
|
2015-01-07 04:14:48 -07:00
|
|
|
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'Vader! test.vader' > /dev/null &&
|
2014-09-26 23:19:11 -07:00
|
|
|
init &&
|
2015-01-07 04:14:48 -07:00
|
|
|
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null
|
2014-06-22 20:47:13 -07:00
|
|
|
else
|
2015-01-07 04:14:48 -07:00
|
|
|
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'Vader test.vader'
|
2014-06-22 20:47:13 -07:00
|
|
|
fi
|
2014-02-11 10:09:24 -07:00
|
|
|
|