Terminal GuideTerminal Guide
oh-my-zsh icon

Oh My Zsh

Shell Enhancements
macOSLinux
Shell

Zsh configuration framework with plugins and themes.

Official Website

Features

Plugin SystemThemesAuto UpdateAliases

Why use Oh My Zsh?

300+ plugins

Aliases and completion features for major tools like Git, Docker, npm, kubectl, and more.

150+ themes

A wide variety of prompt themes available, making it easy to change the appearance.

Huge community

Over 170k stars on GitHub. Active community for continuous development and support.

Easy configuration management

Organize .zshrc settings and manage plugins and themes centrally.

Installation

You can install it with a one-liner using curl or wget.

Using curl

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

Using wget

Install with wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Note: The installation script will backup your existing .zshrc and create a new configuration file for Oh My Zsh.

Shell Configuration

After installation, edit ~/.zshrc to configure themes and plugins.

Basic configuration

~/.zshrc
# Oh My Zsh installation path
export ZSH="$HOME/.oh-my-zsh"

# Theme configuration (specify a theme name from the list below)
ZSH_THEME="robbyrussell"

# Plugin configuration (can specify multiple separated by spaces)
plugins=(git docker npm kubectl)

# Load Oh My Zsh
source $ZSH/oh-my-zsh.sh

# Add custom settings below
# export PATH="$HOME/bin:$PATH"
# alias ll="ls -la"

Theme configuration

Change the prompt appearance by setting the theme name in the ZSH_THEME variable.

Popular themes

robbyrussell (default)

Oh My Zsh's default theme. Simple and lightweight.

myprojectgit:(main)|

agnoster

Powerline-style theme. Requires Nerd Font or Powerline Font.

user@host~/myproject main ±|

af-magic

Clean theme with good balance of information display.

╭─ user@hostname ~/myproject ‹main›
╰─$ |
~/.zshrc
# Change theme example
ZSH_THEME="agnoster"

# Use a random theme
ZSH_THEME="random"

# Randomly select from specific themes
ZSH_THEME_RANDOM_CANDIDATES=(
  "robbyrussell"
  "agnoster"
  "af-magic"
)

Theme list: All themes are located in ~/.oh-my-zsh/themes/. You can also view previews on the official Wiki.

Plugin configuration

You can enable various features by adding plugin names to the plugins array.

Recommended plugins

PluginDescription
gitGit aliases and completion (gst, gco, gcm, etc.)
dockerDocker command completion
npmnpm command completion and aliases
kubectlKubernetes CLI completion
zJump to frequently used directories
sudoAdd sudo to the beginning with Esc×2
historyHistory search aliases
extractExtract various archive formats with x command

Plugin configuration example

~/.zshrc
plugins=(
  git
  docker
  docker-compose
  npm
  node
  kubectl
  z
  sudo
  history
  extract
  colored-man-pages
)

Adding external plugins

You can easily add external plugins like zsh-autosuggestions and zsh-syntax-highlighting.

Install external plugins
# Install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions   $ZSH_CUSTOM/plugins/zsh-autosuggestions

# Install zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git   $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

# Add to plugins in .zshrc
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

Prompt examples

Main aliases when the Git plugin is enabled.

# Example of git aliases
gst = git status
gco = git checkout
gcm = git checkout main
gp = git push
gl = git pull
gd = git diff
ga = git add
gcmsg = git commit -m

Tips

Update Oh My Zsh

Update regularly to keep plugins and themes up to date.

Update commands
# Update manually
omz update

# Configure automatic updates (~/.zshrc)
zstyle ':omz:update' mode auto      # Enable auto-update
zstyle ':omz:update' frequency 7    # Check every 7 days

View aliases

You can view the aliases provided by plugins.

View aliases
# Display all aliases
alias

# Search for Git plugin aliases
alias | grep git

# Check specific alias definition
which gst

Add custom aliases

You can add custom settings at the end of ~/.zshrc or in ~/.oh-my-zsh/custom/.

Custom aliases
# ~/.zshrc or ~/.oh-my-zsh/custom/aliases.zsh

# Aliases for frequently used commands
alias ll="ls -la"
alias ..="cd .."
alias ...="cd ../.."

# Shortcuts to projects
alias proj="cd ~/projects"

# Docker related
alias dps="docker ps"
alias dcp="docker-compose"

Improve startup speed

Installing too many plugins can slow down startup. Enable only the plugins you really need, and consider lazy loading for slow plugins likenvm. You can measure startup time withtime zsh -i -c exit.

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More