-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·85 lines (63 loc) · 2.6 KB
/
setup.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
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env
echo "Setting up..."
CWD="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
install () {
echo "Insalling: $@"
rm -rf "$HOME/$2"
mkdir -p "$(dirname "$HOME/$2")"
if ! [[ "$3" -eq 1 ]]; then
ln -s "$CWD/$1" "$HOME/$2"
else
cp -Ra "$CWD/$1" "$HOME/$2"
fi
}
uninstall () {
rm -rf "$HOME/$1"
}
###############################################################################
# dotfiles
###############################################################################
declare -a files=(
.bash_profile
.bashrc
.dircolors
.editorconfig
.gitconfig
.zshrc
.dircolors
)
for file in "${files[@]}"; do
if [[ -f $file ]]; then
install "$file" "$file"
fi
done
###############################################################################
# vim
###############################################################################
uninstall ".config/nvim"
uninstall ".vim"
uninstall ".vimrc"
install ".vim" ".config/nvim" 1
install ".vimrc" ".config/nvim/init.vim" 1
install ".vim" ".vim" 1
install ".vimrc" ".vimrc" 1
###############################################################################
# oh my zsh
###############################################################################
git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone --depth=1 https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
git clone --depth=1 https://github.com/supercrabtree/k ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins//k
git clone --depth=1 https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autocomplete
git clone --depth=1 git://github.com/wting/autojump.git ~/.oh-my-zsh/autojump-setup
$(cd ~/.oh-my-zsh/autojump-setup && ./install.py)
###############################################################################
# zinit
###############################################################################
rm -rf "$HOME/.zinit"
mkdir "$HOME/.zinit"
git clone --depth=1 https://github.com/zdharma-continuum/zinit.git "$HOME/.zinit/bin"
echo -e "Installation done for the following ${#files[*]} dotfiles: ${files[*]}"
source $HOME/.zshrc