-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-install.sh
42 lines (31 loc) · 928 Bytes
/
auto-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
#!/bin/sh
VIMHOMEDIR=~/.vim
warn() {
echo "$1" >&2
}
die() {
warn "$1"
exit 1
}
echo "Installing ryz' Vim configuration..."
echo
# check if git is installed
command -v git >/dev/null 2>&1 || { echo >&2 "Git is required, but not found! Aborting."; exit 1; }
# check if vim is installed
command -v vim >/dev/null 2>&1 || { echo >&2 "Vim is required, but not found! Aborting."; exit 1; }
# check if Vim/vimrc already exists
[ -e "$VIMHOMEDIR/vimrc" ] && die "$VIMHOMEDIR/vimrc already exists."
[ -e "~/.vim" ] && die "~/.vim already exists."
[ -e "~/.vimrc" ] && die "~/.vimrc already exists."
cd ~
git clone --recursive http://github.com/ryz/vim-ryz.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
echo
cd $VIMHOMEDIR
mkdir -v tmp
mkdir -v backup
echo
echo "ryz' .vim was successfully installed and configured, have fun!"
# deprecated, only needed before Git version 1.6.5
# cd ~/.vim
# git submodule update --init