-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·75 lines (55 loc) · 1.54 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
#!/usr/bin/env bash
DOTFILES=${HOME}/.dotfiles
## Submodules
cd ${DOTFILES}
git submodule update --init --recursive
message () {
echo "Symlinking $1 to $2"
}
## Install NVM
read -p "Install NVM [Y/n]" installNvm
if [[ $installNvm != n ]]; then
echo "Installing NVM"
if ! [[ -d "${HOME}/.nvm" ]]; then
export NVM_DIR="$HOME/.nvm" && (
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"
echo "NVM Installed"
else
echo "NVM already installed"
fi
fi
## ZSHRC
echo "Symlinking .zshrc to ${HOME}/.zshrc"
message .zshrc $HOME/.zshrc
if [[ -d ${HOME}/.zshrc ]]; then
rm -f $HOME/.zshrc
echo "Removed already existing .zshrc"
fi
ln -s ${DOTFILES}/zsh/.zshrc $HOME/.zshrc
## Oh my zsh
message .oh-my-zsh "$HOME/.oh-my-zsh"
if [[ -d "$HOME/.oh-my-zsh" ]]; then
rm -f $HOME/.oh-my-zsh
echo "Removed already existing .oh-my-zsh"
fi
ln -s ${DOTFILES}/zsh/.oh-my-zsh $HOME/.oh-my-zsh
## Vim
message .vim "$HOME/.vim"
if [[ -d "$HOME/.vim" ]]; then
rm -f $HOME/.vim
echo "Removed already existing .vim"
fi
ln -s ${DOTFILES}/vim/.vim $HOME/.vim
if [[ -e "$HOME/.vimrc" ]]; then
rm -f $HOME/.vimrc
echo "Removed already existing .vimrc"
fi
ln -s ${DOTFILES}/vim/.vimrc $HOME/.vimrc
# ## Install Vim plugins
echo "Installing Vim plugins"
vim +PluginInstall +qall
echo "Vim plugins installed"
echo "Now run `source ~/.zshrc`"