forked from nvie/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoinstall.sh
More file actions
executable file
·36 lines (28 loc) · 821 Bytes
/
Copy pathautoinstall.sh
File metadata and controls
executable file
·36 lines (28 loc) · 821 Bytes
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
#!/bin/sh
INSTALL_TO=~/projects
warn() {
echo "$1" >&2
}
die() {
warn "$1"
exit 1
}
[ -e "$INSTALL_TO" ] || die "$INSTALL_TO doesn't exist"
[ -e "$INSTALL_TO/vimrc" ] && die "$INSTALL_TO/vimrc already exists."
[ -e "~/.vim" ] && die "~/.vim already exists."
[ -e "~/.vimrc" ] && die "~/.vimrc already exists."
cd "$INSTALL_TO"
git clone git://github.com/weaksauce/vimrc.git
cd vimrc
# Download vim plugin bundles
git submodule init
git submodule update
# Compile command-t for the current platform
cd vim/ruby/command-t
(ruby extconf.rb && make clean && make) || warn "Ruby compilation failed. Ruby not installed, maybe?"
# Symlink ~/.vim and ~/.vimrc
cd ~
ln -s "$INSTALL_TO/vimrc/vimrc" .vimrc
ln -s "$INSTALL_TO/vimrc/vim" .vim
touch ~/.vim/user.vim
echo "Installed and configured .vim, have fun."