Skip to content

Instantly share code, notes, and snippets.

@dingwen07
Created June 11, 2022 23:23
Show Gist options
  • Save dingwen07/1261eac531f7f080d72b78f931a8ca01 to your computer and use it in GitHub Desktop.
Save dingwen07/1261eac531f7f080d72b78f931a8ca01 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check if zsh is installed
if ! command -v zsh &> /dev/null
then
echo "zsh could not be found"
exit
fi
# Install oh-my-zsh unattended
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Install 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 "" >> ~/.zshrc
echo "# Others" >> ~/.zshrc
echo "HISTSIZE=999999999" >> ~/.zshrc
echo "SAVEHIST=\$HISTSIZE" >> ~/.zshrc
echo "DEFAULT_USER=\$(whoami)" >> ~/.zshrc
echo "Done."
echo "Edit ~/.zshrc to enable plugins:"
echo "plugins=(\n git\n zsh-autosuggestions\n zsh-syntax-highlighting\n)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment