-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·71 lines (56 loc) · 1.71 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
#!/usr/bin/env bash
install_pkgs() {
OS=$(uname)
if [ "$OS" = "Linux" ]; then pkgmanager="sudo apt"
elif [ "$OS" = "Darwin" ]; then pkgmanager="brew"
else
echo "You need to setup a pkgmanager manually for this system.";
exit 1;
fi
pkgs=(
curl zsh fzf fd shellcheck tmux tldr docker ripgrep diff-so-fancy
)
for p in "${pkgs[@]}"; do
brew install $p
done
}
link_configs() {
dotfiles=(
.zshrc .zprofile .vimrc .tmux.conf .gitconfig .aliases .hgrc
)
dotdir="$HOME/dotfiles"
for d in "${dotfiles[@]}"; do
src="$dotdir/$d"; link="$HOME/$d"
ln -fs "$src" "$link"
done
}
setup_vim() {
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +'PlugInstall --sync' +qa
}
setup_shell() {
git clone https://github.com/chriskempson/base16-shell.git \
~/.config/base16-shell
git clone https://github.com/ohmyzsh/ohmyzsh.git \
~/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
$ZSH_CUSTOM/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions \
$ZSH_CUSTOM/plugins/zsh-autosuggestions
# install pure promt '>'
git clone https://github.com/sindresorhus/pure.git \
$HOME/.zsh/pure
# make zsh as a default shell
[[ ! $SHELL =~ .*zsh ]] && chsh -s "$(command -v zsh)" "$USER"
}
completion() {
GREEN='\e[32m'
RESET='\e[0m'
echo -e "${GREEN}We've done! Don't forget to reload your shell!${RESET}"
}
install_pkgs
link_configs
setup_vim
setup_shell
completion