-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·60 lines (47 loc) · 1.31 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
#!/usr/bin/env bash
export dotfiles="$(cd "$(dirname "$0")" && pwd)"
function die {
echo "$@"
exit 1
}
for tool in git rsync vimpager fzf curl
do
which $tool &>/dev/null || die "Please install $tool!"
done
function clone_or_pull {
URL="$1"
DIR="$2"
mkdir -p "$DIR"
echo "Updating $DIR:"
if test -d "$DIR/.git"; then
(cd "$DIR" && git pull)
else
git clone "$URL" "$DIR"
fi
}
clone_or_pull https://github.com/ohmyzsh/ohmyzsh "$dotfiles/zsh/oh-my-zsh"
clone_or_pull https://github.com/zsh-users/zsh-syntax-highlighting "$dotfiles/zsh/plugins/zsh-syntax-highlighting"
clone_or_pull https://github.com/zsh-users/zsh-autosuggestions "$dotfiles/zsh/plugins/zsh-autosuggestions"
rsync -ra $dotfiles/bin/ $HOME/bin/
#for CMD in $dotfiles/bin/*
#do
# ln -sf $CMD $HOME/bin/$(basename $CMD)
#done
cat <<-end > $HOME/.zshrc
# This file will be overwritten!
# Make changes to .zshrc.local instead.
source "$dotfiles/zsh/zshrc"
end
# Vim
test -L $HOME/.vim && rm $HOME/.vim
mkdir -p $HOME/.vim $HOME/.config/nvim $HOME/.local/share/nvim
ln -sf $dotfiles/vimrc $HOME/.vim/vimrc
ln -sf $HOME/.vim/vimrc $HOME/.config/nvim/init.vim
ln -sf $HOME/.vim/ $HOME/.local/share/nvim/site
# TMUX
ln -sf $dotfiles/tmux.conf $HOME/.tmux.conf
# PSQL
ln -sf $dotfiles/psqlrc $HOME/.psqlrc
# Ruby
ln -sf $dotfiles/irbrc $HOME/.irbrc
echo "Done."