This script automates the installation and configuration of Oh My Zsh on macOS, providing options for popular themes and plugins.
- Installs and configures:
- Homebrew (if not installed)
- Zsh (sets it as the default shell)
- Oh My Zsh
- Theme selection:
robbyrussell(Default)agnosterpowerlevel10k(includes font installation)spaceship- Custom theme (from a GitHub repository)
- Configures
.zshrcwith:- The selected theme
- Essential plugins:
git,zsh-autosuggestions,zsh-syntax-highlighting
- Backs up existing
.zshrcto.zshrc.backup. - Installs additional fonts for themes like Powerlevel10k.
- Installs and configures useful Zsh plugins.
Ensure you meet the following requirements before running the script:
- macOS system with administrator privileges.
- An active internet connection.
-
Download the script:
curl -O https://raw.githubusercontent.com/Saba-Var/macos-oh-my-zsh-installer/refs/heads/main/macos-oh-my-zsh-installer.sh
-
Make the script executable:
chmod +x macos-oh-my-zsh-installer.sh
-
Run the script:
./macos-oh-my-zsh-installer.sh
-
Follow the on-screen instructions to select a theme and complete the installation.
When prompted, select one of the following themes:
- robbyrussell: Default theme.
- agnoster: Powerline-style theme.
- powerlevel10k: Feature-rich customizable theme. The script installs the recommended font (MesloLGS NF).
- spaceship: Minimalistic and powerful theme.
- Custom theme: Specify a GitHub repository URL in the format
user/repo.
The script installs the following plugins to enhance your Zsh experience:
- zsh-autosuggestions: Suggests commands as you type based on history and completions.
- zsh-syntax-highlighting: Highlights command syntax for better readability.
- Any existing
.zshrcfile is automatically backed up as.zshrc.backupin your home directory.
If you select the Powerlevel10k theme, the MesloLGS NF font will be installed.
- Open your terminal preferences.
- Set the font to MesloLGS NF in the terminal profile settings.
- Homebrew not installed: Ensure you have admin rights to install Homebrew.
- Zsh not set as default shell: Restart your terminal after the script runs.
After installation, restart your terminal to apply all changes.
To revert the changes made by the script:
-
Remove the
.oh-my-zshdirectory:rm -rf ~/.oh-my-zsh -
Restore the backed-up
.zshrcfile:mv ~/.zshrc.backup ~/.zshrc
-
Restart your terminal.
This script is distributed under the MIT License. Use it at your own risk.
Enjoy your enhanced Zsh experience! π