-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·55 lines (44 loc) · 1.42 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
#!/bin/bash
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# submodule init
git submodule update --init
set_soft_link() {
left_file=$1
right_file=$2
if [[ -e $right_file ]]; then
echo "File $right_file already exists."
read -p "Do you want to delete it? (y/n) " choice
if [[ "$choice" == "y" ]]; then
rm -rf $right_file
ln -s $left_file $right_file
echo "$right_file Symbolic link created."
else
echo "Aborted."
fi
else
ln -s $left_file $right_file
echo "$right_file Symbolic link created."
fi
}
# zshrc
set_soft_link "$BASEDIR/zshrc" ~/.zshrc
# oh-my-zsh
if [[ ! -e ~/.oh-my-zsh ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
if [[ ! -e ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ]]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
fi
if [[ ! -e ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ]]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
fi
# neovim
set_soft_link "$BASEDIR/nvim" ~/.config/nvim
# gitconfig
set_soft_link "$BASEDIR/gitconfig" ~/.gitconfig
# ideavimrc
set_soft_link "$BASEDIR/ideavimrc" ~/.ideavimrc
# zed
set_soft_link "$BASEDIR/zed" ~/.config/zed
# tmux
set_soft_link "$BASEDIR/tmux.conf" ~/.tmux.conf