Last active
April 26, 2025 16:30
-
-
Save spencershepard/16886341d33952bd5ba04ab8a91f9466 to your computer and use it in GitHub Desktop.
Install zshell and auto-suggestions (Ubuntu)
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 | |
ZSHRC_FILE="$HOME/.zshrc" | |
echo "Installing packages..." | |
apt update && apt install -y zsh zsh-autosuggestions zsh-syntax-highlighting | |
# Check if the .zshrc file exists | |
if [[ ! -f "$ZSHRC_FILE" ]]; then | |
echo "$ZSHRC_FILE not found. Creating..." | |
touch "$ZSHRC_FILE" | |
fi | |
# Search for "zsh-autosuggestions" in the .zshrc file | |
if grep -q "zsh-autosuggestions" "$ZSHRC_FILE"; then | |
echo "zsh-autosuggestions is already configured in .zshrc" | |
else | |
echo "Plugins not found in $ZSHRC_FILE. Adding..." | |
echo "source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >> "$ZSHRC_FILE" | |
echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$ZSHRC_FILE" | |
fi | |
echo "Changing default shell to zsh..." | |
chsh -s /usr/bin/zsh | |
echo "zsh will be available for $USER after next login" | |
echo "Run 'source $ZSHRC_FILE' to apply changes immediately" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl https://gist.githubusercontent.com/spencershepard/16886341d33952bd5ba04ab8a91f9466/raw/b7659762f4ee6bebe917835e0ac145f4564fa1b7/install-zsh.sh | bash