-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·199 lines (153 loc) · 3.5 KB
/
install.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/bin/bash
set -ev
me=`basename $0`
function error_exit
{
local parent_lineno="$1"
local message="$2"
local code="${3:-1}"
if [[ -n "$message" ]] ; then
echo "Error on or near line ${parent_lineno}: ${message}; exiting with status ${code}"
else
echo "Error on or near line ${parent_lineno}; exiting with status ${code}"
fi
exit "${code}"
}
function on_exit(){
echo $PROGRESS > $PROGRESS_FILE
}
trap 'error_exit ${LINENO}' ERR
trap 'on_exit ' EXIT
PROGRESS_FILE=env_install_progress.txt
if [ -f $PROGRESS_FILE ]; then LOADED_PROGRESS=$(<${PROGRESS_FILE}); fi
PROGRESS=${LOADED_PROGRESS:-0}
STEP=0
if (( PROGRESS < STEP )); then
mkdir -p ~/.vim/bundle
cp -f .vim/vim_plugins ~/.vim/
cp -f .vim/vimrc ~/.vim/
pushd ~/
ln -snf .vim/vimrc ~/.vimrc
ln -snf .vim .config/nvim
popd
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo Install Nvim
git clone https://github.com/neovim/neovim.git
pushd neovim
make
sudo make install
popd
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo Install Vundle
mkdir -p ~/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim -c 'PluginInstall' -c 'q'
vim -c 'so %' -c 'q' Align.vba
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
git clone https://github.com/powerline/fonts.git powerline-fonts
pushd powerline-fonts
./install.sh
popd
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
cp .Xdefaults ~/
xrdb ~/.Xdefaults
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo compile YouCompleteMe with clang-completer
pushd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
popd
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo Installing tmux
sudo apt-get install tmux
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo Installing tmux package manager
mkdir -p ~/.tmux/plugins/tpm
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
cp .tmux.conf ~/
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo Upgrading git
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update || true
sudo apt-get install git gitk
git --version
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
git config --global user.name "$(getent passwd $USER | awk '{split($0,ent,":"); print ent[5]}')"
git config --global user.name
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
git config --global push.default simple
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
if [ -z ${GIT_EMAIL+x} ]; then echo "Must set GIT_EMAIL environment variable to proceed" exit 1; fi
git config --global user.email "${GIT_EMAIL}"
git config --global user.email
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
echo Installing git WebUI
git clone https://github.com/alberthier/git-webui.git
git config --global alias.webui \!$PWD/git-webui/release/libexec/git-core/git-webui
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
sudo apt-add-repository ppa:george-edison55/cmake-3.x
sudo apt-get update || true
sudo apt-get install cmake
((PROGRESS+=1))
fi
((STEP+=1))
ST_GIT=http://git.suckless.org/st
if (( PROGRESS < STEP )); then
echo Installing st
sudo apt-get install libxt-dev libxft-dev
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
git clone ${ST_GIT}
((PROGRESS+=1))
fi
((STEP+=1))
if (( PROGRESS < STEP )); then
pushd st
cp ../st-config/config.h .
make
make install PREFIX=$HOME
popd
((PROGRESS+=1))
fi
((STEP+=1))
echo done