-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap.sh
55 lines (45 loc) · 1.19 KB
/
bootstrap.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
#!/usr/bin/env sh
endpath="$HOME/.2ret-vim"
warn() {
echo "$1" >&2
}
die() {
warn "$1"
exit 1
}
lnif() {
if [ ! -e $2 ] ; then
ln -s $1 $2
fi
if [ -L $2 ] ; then
ln -sf $1 $2
fi
}
echo "thanks for installing 2ret-vim\n"
# Backup existing .vim stuff
echo "backing up current vim config\n"
today=`date +%F-%T`
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do [ -e $i ] && [ ! -L $file ] && mv $i $i.$today; done
if [ ! -e $endpath/.git ]; then
echo "cloning 2ret-vim\n"
git clone --recursive http://github.com/benichu/2ret-vim.git $endpath
else
echo "updating 2ret-vim\n"
cd $endpath && git pull
fi
echo "setting up symlinks"
lnif $endpath/.vimrc $HOME/.vimrc
lnif $endpath/.vimrc.bundles $HOME/.vimrc.bundles
lnif $endpath/.vim $HOME/.vim
if [ ! -d $endpath/.vim/bundle ]; then
mkdir -p $endpath/.vim/bundle
fi
if [ ! -e $HOME/.vim/bundle/vundle ]; then
echo "Installing Vundle\n"
git clone http://github.com/gmarik/vundle.git $HOME/.vim/bundle/vundle
fi
echo "update/install plugins using Vundle"
system_shell=$SHELL
export SHELL="/bin/sh"
vim -u $endpath/.vimrc.bundles +PluginInstall! +PluginClean +qall
export SHELL=$system_shell