-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·47 lines (43 loc) · 1.29 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
#! /bin/bash
# Check for instillation of git, vim, tmux, and zsh
command -v git >/dev/null 2>&1 ||\
{ echo >&2 "How are you even running this without git?"; exit 1; }
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# link vimrc
if command -v vim >/dev/null 2>&1; then
echo "Linking vim configs"
ln -s $DIR/vim ~/.vim
if [ ! -d ~/.vim/bundle/vundle ]; then
git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
fi
if [ -e ~/.vimrc ]; then
echo ".vimrc detected, save anything important and remove it"
else
ln -s $DIR/vimrc ~/.vimrc
fi
if [ -e ~/.vimrc.bundles ]; then
echo ".vimrc.bundles detected, save anything important and remove it"
else
ln -s $DIR/vimrc.bundles ~/.vimrc.bundles
fi
cp vimrc.local ~/.vimrc.local
cp vimrc.bundles.local ~/.vimrc.bundles.local
vim +PluginInstall +qall >/dev/null 2&>/dev/null
else
echo "vim not found, install it to configure"
fi
# clone oh-my-zsh
if command -v zsh >/dev/null 2>&1; then
echo "Linking zsh configs"
if [ ! -d ~/.oh-my-zsh ]; then
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
fi
if [ -e ~/.zshrc ]; then
echo ".zshrc detected, save anything important and remove it"
else
ln -s $DIR/zshrc ~/.zshrc
fi
cp zshrc.local ~/.zshrc.local
else
echo "zsh not found, install it to configure"
fi