forked from image357/.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·137 lines (113 loc) · 3.06 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
#!/bin/bash
set -e
# path variables
BASE_PATH="$HOME/.vim"
PATHOGEN_PATH="$HOME/.vim/pathogen"
ACKVIM_PATH="$BASE_PATH/bundle/ack.vim"
COMMANDT_PATH="$BASE_PATH/bundle/command-t"
GRUVBOX_PATH="$BASE_PATH/bundle/gruvbox"
GUNDOVIM_PATH="$BASE_PATH/bundle/gundo.vim"
YOUCOMPLETEME_PATH="$BASE_PATH/bundle/YouCompleteMe"
# version variables
PATHOGEN_VERSION="master"
ACKVIM_VERSION="master"
COMMANDT_VERSION="tags/5.0.3"
GRUVBOX_VERSION="tags/v3.0.1-rc.0"
GUNDOVIM_VERSION="tags/v2.6.2"
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="$?"
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 command-t
startsetup "command-t"
cd "$COMMANDT_PATH"
git checkout "$COMMANDT_VERSION"
git submodule update --init --recursive
cd "$COMMANDT_PATH/ruby/command-t/ext/command-t"
ruby extconf.rb
if [ "$FBSDTEST" == "" ]; then
make
else
gmake
fi
endsetup "command-t"
# 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 YouCompleteMe
startsetup "YouCompleteMe"
cd "$YOUCOMPLETEME_PATH"
if [ "$CYGTEST" == "" ]; then
git checkout "$YOUCOMPLETEME_VERSION"
git submodule update --init --recursive
if [ "$GOTEST" == "0" ]; then
echo "compiling with go completer"
./install.py --clang-completer --go-completer
else
./install.py --clang-completer
fi
else
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"