Created
December 18, 2023 07:13
-
-
Save dnegi-dev/70a4a96730bc1c062fd512165fb04c30 to your computer and use it in GitHub Desktop.
install_zsh_plugins.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if zsh is installed | |
if ! command -v zsh &> /dev/null; then | |
echo "Zsh is not installed. Please install it first." | |
exit 1 | |
fi | |
if ! command -v git &> /dev/null; then | |
echo "Git is not installed, Please install it first." | |
exit 1 | |
fi | |
# Set the ZSH custom plugins directory | |
ZSH_CUSTOM_PLUGINS_DIR=$HOME/.oh-my-zsh/custom/plugins | |
# Clone zsh-autosuggestions | |
git clone https://github.com/zsh-users/zsh-autosuggestions.git "$ZSH_CUSTOM_PLUGINS_DIR"/zsh-autosuggestions | |
# Clone zsh-history-substring-search | |
git clone https://github.com/zsh-users/zsh-history-substring-search.git "$ZSH_CUSTOM_PLUGINS_DIR"/zsh-history-substring-search | |
# Clone zsh-syntax-highlighting | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM_PLUGINS_DIR"/zsh-syntax-highlighting | |
# Update zsh configuration to activate plugins and change theme | |
sed -i -E 's/^plugins=\((.*)\)/plugins=(\1 zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search )/' "$HOME"/.zshrc | |
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="gentoo"/' "$HOME"/.zshrc | |
echo "Zsh plugins installation completed. Please restart your shell to apply changes." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment