-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.sh
executable file
·149 lines (121 loc) · 3.4 KB
/
setup.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/bin/sh
set -e
# path variables
BASE_PATH="$HOME/.vim"
PATHOGEN_PATH="$HOME/.vim/pathogen"
ACKVIM_PATH="$BASE_PATH/bundle/ack.vim"
CTRLP_PATH="$BASE_PATH/bundle/ctrlp.vim"
GRUVBOX_PATH="$BASE_PATH/bundle/gruvbox"
GUNDOVIM_PATH="$BASE_PATH/bundle/gundo.vim"
NERDCOMMENTER_PATH="$BASE_PATH/bundle/nerdcommenter"
YOUCOMPLETEME_PATH="$BASE_PATH/bundle/YouCompleteMe"
# version variables
PATHOGEN_VERSION="master"
ACKVIM_VERSION="master"
CTRLP_VERSION="master"
GRUVBOX_VERSION="master"
GUNDOVIM_VERSION="master"
NERDCOMMENTER_VERSION="master"
YOUCOMPLETEME_VERSION="master"
# operating system test
CYGTEST=`uname -a | grep -i cygwin | cat`
FBSDTEST=`uname -a | grep -i FreeBSD | cat`
# language support tests
set +e
command -v go > /dev/null
GOTEST="$?"
command -v rustc > /dev/null
RUSTTEST="$?"
set -e
# print functions
function startsetup {
echo ""
echo "----------------------------------------"
echo " start: setup of $1"
echo "----------------------------------------"
echo ""
}
function endsetup {
echo ""
echo "----------------------------------------"
echo " done: setup of $1"
echo "----------------------------------------"
echo ""
}
# init submodules
cd "$BASE_PATH"
git submodule update --init
git submodule update --remote
# setup pathogen
startsetup "pathogen.vim"
cd "$PATHOGEN_PATH"
git checkout "$PATHOGEN_VERSION"
git submodule update --init --recursive
cp "$PATHOGEN_PATH/autoload/pathogen.vim" "$BASE_PATH/autoload/pathogen.vim"
cd "$BASE_PATH"
git update-index --assume-unchanged "autoload/pathogen.vim"
endsetup "pathogen.vim"
# setup ack.vim
startsetup "ack.vim"
cd "$ACKVIM_PATH"
git checkout "$ACKVIM_VERSION"
git submodule update --init --recursive
endsetup "ack.vim"
# setup ctrlp
startsetup "ctrlp"
cd "$CTRLP_PATH"
git checkout "$CTRLP_VERSION"
git submodule update --init --recursive
endsetup "ctrlp"
# setup gruvbox
startsetup "gruvbox"
cd "$GRUVBOX_PATH"
git checkout "$GRUVBOX_VERSION"
git submodule update --init --recursive
endsetup "gruvbox"
# setup gundo.vim
startsetup "gundo.vim"
cd "$GUNDOVIM_PATH"
git checkout "$GUNDOVIM_VERSION"
git submodule update --init --recursive
endsetup "gundo.vim"
# setup nerdcommenter
startsetup "nerdcommenter"
cd "$NERDCOMMENTER_PATH"
git checkout "$NERDCOMMENTER_VERSION"
git submodule update --init --recursive
endsetup "nerdcommenter"
# setup YouCompleteMe
startsetup "YouCompleteMe"
cd "$YOUCOMPLETEME_PATH"
COMPLETER_OPTIONS="--clangd-completer"
if [ "$GOTEST" == "0" ]; then
echo "compiling with go completer"
COMPLETER_OPTIONS="$COMPLETER_OPTIONS --go-completer"
fi
if [ "$RUSTTEST" == "0" ]; then
echo "compiling with rust completer"
COMPLETER_OPTIONS="$COMPLETER_OPTIONS --rust-completer"
fi
if [ "$CYGTEST" == "" ]; then
git checkout "$YOUCOMPLETEME_VERSION"
git submodule update --init --recursive
./install.py $COMPLETER_OPTIONS
else
# cygwin setup is very old, may need an update
git checkout "95efbc87668783be8eadd94945cf6eba70823eea"
git submodule update --init --recursive
if [ "$GOTEST" == "0" ]; then
echo "compiling with go completer"
./install.py --clang-completer --system-libclang --go-completer
else
./install.py --clang-completer --system-libclang
fi
echo "warning: Cygwin uses system libclang"
fi
endsetup "YouCompleteMe"
# init Helptags
startsetup "vim Helptags"
echo "generating Helptags ..."
vim +Helptags +qall
endsetup "vim Helptags"