Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created August 30, 2023 08:04
Show Gist options
  • Save naranyala/b389b5886a5c98c1dc6a804e53f6a085 to your computer and use it in GitHub Desktop.
Save naranyala/b389b5886a5c98c1dc6a804e53f6a085 to your computer and use it in GitHub Desktop.
three main zsh plugins repo clones
#!/bin/bash
# Define the directory where Zsh plugins will be installed
ZSH_CUSTOM="$HOME/.oh-my-zsh/custom/plugins"
# Define an array of plugin names
plugins=("zsh-autosuggestions" "zsh-completions" "zsh-syntax-highlighting")
# Loop through the plugins and clone their repositories
for plugin in "${plugins[@]}"; do
# Check if the plugin directory already exists
if [ -d "$ZSH_CUSTOM/$plugin" ]; then
echo "$plugin is already installed. Skipping."
else
# Clone the plugin repository from GitHub
git clone https://github.com/zsh-users/"$plugin" "$ZSH_CUSTOM/$plugin"
# Check if the clone was successful
if [ $? -eq 0 ]; then
echo "Successfully installed $plugin."
else
echo "Failed to install $plugin. Check your internet connection or permissions."
fi
fi
done
# Optionally, you can update your .zshrc file to enable these plugins if you're using Oh My Zsh
# Example: plugins=(zsh-autosuggestions zsh-completions zsh-syntax-highlighting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment