Skip to content

Instantly share code, notes, and snippets.

@sainf
Last active February 20, 2025 11:31
Show Gist options
  • Save sainf/9a8d295f81cd5963d6859468a0c7b5a6 to your computer and use it in GitHub Desktop.
Save sainf/9a8d295f81cd5963d6859468a0c7b5a6 to your computer and use it in GitHub Desktop.
My custom OMyZShell install
#!/bin/bash
# Prompt for sudo password
echo "Enter your sudo password:"
sudo -v
# Install necessary packages
sudo dnf install -y zsh git zoxide
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Clone zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Clone fzf-tab
git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab
# Clone zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Modify .zshrc
sed -i 's/plugins=(.*git.*)/plugins=(git z themes fzf zsh-autosuggestions fzf-tab zsh-syntax-highlighting)/' ~/.zshrc
# Add prompt and LS_COLORS to .zshrc
echo "" >> ~/.zshrc #add a blank line for readability
echo "## Prompt" >> ~/.zshrc
echo "HOSTNAME=\$(hostname -f)" >> ~/.zshrc
echo "PROMPT='\${ret_status}%{\${fg[yellow]}}%n@\$HOSTNAME:%{\${fg[cyan]}}%d%{\${reset_color%}} \$(git_prompt_info)'" >> ~/.zshrc
echo "export LS_COLORS=\"\$LS_COLORS:ow=1;34:tw=1;34:\"" >> ~/.zshrc
# Add node modules path
echo "" >> ~/.zshrc #add a blank line for readability
echo "## Node Modules" >> ~/.zshrc
echo "export PATH=\$PATH/\$HOME/.node-packages/bin" >> ~/.zshrc
echo ".zshrc modified. Please restart your terminal or run 'source ~/.zshrc'."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment