Skip to content
Shell & TerminalHow-To Published Updated 4 min readViews unavailable

How to Set Up Zsh With Oh My Zsh

Installing Zsh as your shell, setting up Oh My Zsh, and configuring a theme and a first useful plugin, from a default shell to a productive one.

Oh My Zsh turns Zsh’s genuinely powerful but complex configuration system into something installable and usable within minutes — this walks through going from scratch to a working, themed setup.

Step 1: install Zsh if it isn’t already present

sudo apt install zsh      # Debian/Ubuntu
brew install zsh          # macOS (though Zsh ships by default since Catalina)
pkg install zsh           # FreeBSD

Step 2: set Zsh as your default shell

chsh -s $(which zsh)

This changes your account’s default login shell — you’ll need to log out and back in (or open a new terminal session, depending on your system) for the change to take effect.

Step 3: install Oh My Zsh

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

The installer backs up any existing .zshrc and replaces it with an Oh My Zsh-managed configuration file, then launches a new Zsh session automatically.

Step 4: choose a theme

# in ~/.zshrc
ZSH_THEME="robbyrussell"

robbyrussell is Oh My Zsh’s original default theme; dozens of others are bundled — browse the themes/ directory inside your Oh My Zsh installation, or check the project’s own theme gallery, to pick one matching your preferences.

Step 5: enable your first plugin

# in ~/.zshrc
plugins=(git)

The git plugin (enabled by default in most Oh My Zsh setups) adds numerous short aliases for common git commands and shows the current branch and status directly in your prompt.

Step 6: reload your configuration to apply changes

source ~/.zshrc

Step 7: add a useful additional plugin

# in ~/.zshrc
plugins=(git zsh-autosuggestions)

zsh-autosuggestions (installed separately as a custom plugin, per its own documentation) suggests commands as you type based on your history, a feature fish provides natively but Zsh needs a plugin for.

Step 8: keep your plugin list intentional, not exhaustive

Add plugins one at a time as you find you actually want their specific functionality, checking each addition’s effect on shell startup time — an overloaded plugin list is one of the most common causes of slow shell startup, and it’s easier to keep a lean, deliberate configuration from the start than to prune an accumulated one later.

Step 9: update Oh My Zsh periodically

omz update

Why starting minimal and adding deliberately beats copying someone else’s full configuration

A configuration copied wholesale from someone else’s dotfiles repository often includes plugins, aliases, and settings tuned for their specific workflow, not yours — starting from Oh My Zsh’s sensible defaults and adding features only as you discover you actually want them produces a configuration you understand completely and that stays fast, rather than one carrying invisible overhead from features you never use.

Why the installer replaces rather than merely appends to your existing config

Oh My Zsh’s install script backs up and fully replaces .zshrc rather than trying to merge into an existing one, specifically because reliably merging arbitrary existing shell configuration is a much harder and more error-prone problem than starting from a known-good template — if you had meaningful customizations in a previous .zshrc, they’re preserved in the backup file the installer creates, not discarded, but you’ll need to deliberately re-add anything you want to keep rather than assuming it survived the install automatically.

Step 10: add syntax highlighting as a second essential plugin

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

# in ~/.zshrc — must be the LAST plugin in the list
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

zsh-syntax-highlighting colors commands as you type — green for a valid, resolvable command, red for one that doesn’t exist — catching a typo’d command name before you’ve even pressed Enter rather than after seeing a “command not found” error. It specifically needs to be the last entry in the plugins array; loading it before other plugins that also wrap or modify command-line input causes it to miss part of what it’s meant to highlight.

Why Oh My Zsh isn’t the only plugin manager worth knowing about

Oh My Zsh’s convenience comes with real startup-time cost as the plugin list grows — every plugin loads synchronously and fully before the prompt appears, and with a large plugin list that lag becomes noticeable. Newer plugin managers, particularly Zinit and Antidote, address this specifically through lazy-loading: features get loaded on demand or deferred until just after the prompt is already usable, rather than blocking every new shell launch on loading everything up front. Independent benchmarking has shown Oh My Zsh’s startup lag running roughly 3-4x past the threshold most people consciously notice, while Zinit and Antidote keep that same metric close to imperceptible — a meaningful difference for anyone opening many new terminal sessions throughout the day. Oh My Zsh’s much larger plugin and theme ecosystem, plus genuinely simpler day-one setup, still make it the reasonable default for most people starting out; switching to a faster manager is worth revisiting specifically once your own plugin list has grown long enough that shell startup has become an actual, noticeable annoyance rather than a theoretical concern.

Related:

Sources:

Comments