-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_zsh.sh
executable file
·33 lines (29 loc) · 1.11 KB
/
setup_zsh.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
#!/bin/bash
# Check if oh-my-zsh is installed, if not install it
if [[ ! -d $HOME/.oh-my-zsh ]]; then
echo "Installing oh-my-zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
if [ $? -gt 0 ]; then
echo "Error installing oh-my-zsh. Abort."
exit 1
fi
echo
fi
# Install zsh-autosuggestions + zsh-syntax-highlighting if not installed
if [[ ! -d $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions ]]; then
echo "Installing zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo
fi
if [[ ! -d $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting ]]; then
echo "Installing zsh-syntax-highlighting"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
echo
fi
# Symlink .zshrc
echo "Symlinking $HOME/.zshrc to $HOME/.dotfiles/.zshrc"
[[ -f $HOME/.zshrc ]] && mv $HOME/.zshrc $HOME/.zshrc.pre-dotfiles
ln -s $HOME/.dotfiles/.zshrc $HOME/.zshrc
echo
echo "Done!"
echo