forked from fatih/vim-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-vim
executable file
·51 lines (43 loc) · 1.12 KB
/
run-vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# Run a "bare" Vim with just vim-go and ignoring ~/.vim
#
set -euC
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
cd "$vimgodir"
coverage=0
while getopts "c" option; do
case "$option" in
c) coverage=1; ;;
esac
done
shift $((OPTIND - 1))
if [ -z "${1:-}" ]; then
echo "unknown version: '${1:-}'"
echo "First argument must be 'vim-8.0' or 'nvim'."
exit 1
fi
dir="/tmp/vim-go-test/$1-install"
export GOPATH=$dir
export GO111MODULE=auto
export PATH=${GOPATH}/bin:$PATH
shift
if [ ! -f "$dir/bin/vim" ]; then
echo "$dir/bin/vim doesn't exist; did you install it with the install-vim script?"
exit 1
fi
if [ $coverage -eq 1 ]; then
covimerage -q run --report-file /tmp/vim-go-test/cov-profile.txt --append \
$dir/bin/vim --noplugin -u NONE -N \
+"set shm+=WAFI rtp^=$vimgodir packpath=$dir/share/vim/vimgo" \
+'filetype plugin indent on' \
+'packloadall!' \
"$@"
else
$dir/bin/vim --noplugin -u NONE -N \
+"set shm+=WAFI rtp^=$vimgodir packpath=$dir/share/vim/vimgo" \
+'filetype plugin indent on' \
+'packloadall!' \
"$@"
fi
# vim:ts=2:sts=2:sw=2:et