IconMaksym Solomkin

Terminal Setup for macOS: ZSH + Oh My Zsh

Posted on December 21, 2025

I spent way too much time tweaking my terminal setup over the years. This is what I ended up with: syntax highlighting that catches typos before I hit enter, autosuggestions that complete commands from my history as I type, and fuzzy search to dig up that docker command I ran three months ago. The whole setup takes about 10 minutes.

Terminal with Oh My Zsh and syntax highlighting
Terminal with Oh My Zsh and syntax highlighting

Quick Start

  1. Install iTerm2 (optional but recommended)
  2. Install Homebrew for package management
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install fzf for fuzzy finding
brew install fzf
  1. Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. Install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. Install zsh-autocomplete
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete
  1. Install fast-syntax-highlighting
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git \
  ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
  1. Add plugins to ~/.zshrc (see Configuration) and reload:
source ~/.zshrc

Key Components

Terminal Application

Terminal.app works, but lacks split panes and GPU acceleration. I use iTerm2, but there are other options depending on what you need:

Shell Framework: Oh My Zsh

Oh My Zsh handles plugin loading and provides ~300 plugins out of the box. Instead of writing shell scripts, you add plugin names to an array in ~/.zshrc.

If startup feels slow, zinit or antidote offer lazy loading for faster shell init.

Autocompletion Plugins

These two plugins do different things, and I use both:

You can use one or both depending on preference. I like having both since they complement each other.

History Search

Use Ctrl+R to trigger history search. With fzf installed and enabled through Oh My Zsh, you get a fuzzy finder for your command history that's much more powerful than the default search.

fzf history search in action
fzf history search in action

Themes

Themes control how your prompt looks but don't affect behavior. Oh My Zsh includes many built-in themes configured via the ZSH_THEME variable in ~/.zshrc:

ZSH_THEME="robbyrussell"  # minimal, fast
# ZSH_THEME="agnoster"    # shows git branch, needs Nerd Fonts

Some themes (like agnoster, powerlevel10k) require special fonts to display icons and symbols correctly. Install Nerd Fonts to get these working:

brew install --cask font-meslo-lg-nerd-font

Then set the font in your terminal app settings. If you see broken characters or squares in your prompt, you likely need to install and configure a Nerd Font.

For a cross-shell alternative, check out Starship, a fast, customizable prompt that works across different shells.

Starship demo
Starship demo

Configuration

Here's a recommended Oh My Zsh plugins configuration for ~/.zshrc:

plugins=(
    git                      # aliases: gst, gco, gp, gcmsg, etc.
    macos                    # ofd (open Finder), pfd (print Finder dir)
    zsh-autosuggestions      # gray text suggestions from history
    zsh-autocomplete         # dropdown completion menu
    fzf                      # fuzzy finder integration
    sudo                     # press Esc twice to add sudo
    colored-man-pages        # syntax highlighting in man pages
    history-substring-search # must be after zsh-autosuggestions
    fast-syntax-highlighting # must be last
    # Optional:
    # aws docker npm
)

Performance tip: Each plugin adds to your shell startup time. Only include plugins you actually use. If shell init feels slow, try removing some plugins.

Extending PATH

To add directories to your PATH:

export PATH=$PATH:/path/to/your/bin

Aliases and Functions

Shortcuts for frequently used commands. Add to your ~/.zshrc:

# Create directory and cd into it
mkcd() {
    mkdir -p "$1" && cd "$1"
}
 
# Quick navigation
alias ..="cd .."
alias ...="cd ../.."
 
# List files with details
alias ll="ls -la"
 
# Confirm before overwriting
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"
 
# Git shortcuts
alias gst="git status"
alias gp="git pull"
alias gc="git commit"

Optional: Terminal Multiplexers

Use tmux or Zellij if you want session management and window splitting:

Both let you split screens, manage workspaces, and keep sessions running after disconnection (useful for SSH - reconnect and your session is still there).

Troubleshooting

Slow shell startup

Too many plugins or a heavy theme can slow things down. Measure shell init time with:

time zsh -i -c exit

Anything under 0.5s is fine. If it's slower, remove unused plugins or switch to a lighter theme like robbyrussell.

Plugins not loading

Check that the plugin exists in ~/.oh-my-zsh/custom/plugins/ and is spelled correctly in the plugins array.

Autosuggestions not showing

Verify zsh-autosuggestions is in your plugins array. Some terminal color schemes make suggestions invisible. Try a different terminal or theme.

Broken prompt or weird characters

Your theme likely requires Nerd Fonts. See Themes section for installation. Or switch to a simpler theme like robbyrussell.

Command not found after PATH change

Changes to ~/.zshrc require reloading. Run source ~/.zshrc or restart your terminal.

Quick Reference: Keyboard Shortcuts

These work in ZSH and most other shells:

ShortcutAction
Ctrl+AMove to beginning of line
Ctrl+EMove to end of line
Ctrl+UClear entire line
Ctrl+WDelete word before cursor
Ctrl+RSearch command history
Ctrl+LClear screen (keeps scrollback)
Cmd+KClear screen and scrollback (iTerm2)
TabAutocomplete

Further Reading