Skip to content

Oh My Zsh – Supercharge Your Terminal on macOS

Use at your own risk. All guides and scripts are provided for educational purposes only. Always review and understand any code before running it — especially with administrative privileges. Test in a safe environment before using in production. Your system, your responsibility.

Oh My Zsh is an open-source framework for managing your zsh configuration. It comes with hundreds of plugins, themes, and helpers that make your terminal significantly more powerful and enjoyable to use.

What you get:

  • A much nicer looking prompt with useful info
  • Autocompletion for git, docker, kubectl, and more
  • Syntax highlighting and command suggestions
  • Easy plugin and theme management

Requirements

  • macOS with zsh (default since Catalina)
  • Homebrew installed
  • Git installed (brew install git)

Step 1 – Install Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

The installer will:

  • Back up your existing ~/.zshrc to ~/.zshrc.pre-oh-my-zsh
  • Create a new ~/.zshrc with Oh My Zsh configuration
  • Set Oh My Zsh as the default zsh framework

Restart your terminal or run:

source ~/.zshrc

Step 2 – Change the Theme

Oh My Zsh comes with many built-in themes. The default is robbyrussell.

Open your config:

nano ~/.zshrc

Find this line and change the theme:

ZSH_THEME="robbyrussell"

Popular built-in themes:

Theme Description
robbyrussell Default — clean and minimal
agnoster Shows git branch and status (requires Powerline font)
af-magic Colorful, shows user and path clearly
bira Multi-line prompt with git info
simple Very minimal

To see all available themes:

ls ~/.oh-my-zsh/themes/

Or browse them at github.com/ohmyzsh/ohmyzsh/wiki/Themes.

Save and reload:

source ~/.zshrc

Step 3 – Install a Powerline Font (Optional)

Some themes like agnoster require a Nerd Font to display icons correctly.

Install via Homebrew:

brew tap homebrew/cask-fonts
brew install --cask font-meslo-lg-nerd-font

Then set the font in your terminal:

  • Terminal.app: Preferences → Profiles → Text → Change Font
  • iTerm2: Preferences → Profiles → Text → Font

Step 4 – Enable Plugins

Plugins add autocompletion and shortcuts for specific tools. Edit ~/.zshrc:

nano ~/.zshrc

Find the plugins line and add what you need:

plugins=(
  git
  docker
  docker-compose
  brew
  macos
  zsh-autosuggestions
  zsh-syntax-highlighting
)

Built-in plugins (no installation needed):

Plugin What it adds
git Git aliases and autocompletion
docker Docker command autocompletion
docker-compose Compose autocompletion
brew Homebrew aliases
macos macOS-specific commands
sudo Press ESC twice to add sudo to last command
copypath Copy current path to clipboard

Step 5 – Install Popular Third-Party Plugins

Two of the most useful plugins require separate installation:

zsh-autosuggestions – suggests commands as you type based on history:

git clone https://github.com/zsh-users/zsh-autosuggestions \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-syntax-highlighting – highlights commands in green (valid) or red (invalid):

git clone https://github.com/zsh-users/zsh-syntax-highlighting \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Add both to your plugins list in ~/.zshrc, then reload:

source ~/.zshrc

Step 6 – Install Powerlevel10k (Optional but Recommended)

Powerlevel10k is the most popular Oh My Zsh theme — fast, highly configurable, and looks great.

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \
  ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Set it as your theme in ~/.zshrc:

ZSH_THEME="powerlevel10k/powerlevel10k"

Reload and follow the interactive configuration wizard:

source ~/.zshrc

The wizard walks you through choosing your preferred style — icons, colors, prompt elements — and saves everything automatically.


Useful Oh My Zsh Commands

Command What it does
omz update Update Oh My Zsh
omz reload Reload configuration
omz plugin list List available plugins
omz theme list List available themes
omz theme set robbyrussell Switch theme without editing config

Keep Your Aliases

Oh My Zsh creates a new ~/.zshrc but your aliases still belong there. Add them at the bottom of ~/.zshrc, or keep them in a separate ~/.zsh_aliases file and source it:

# Add to the bottom of ~/.zshrc
source ~/.zsh_aliases

Related Links