Terminal Setup Guide

A comprehensive guide to setting up a powerful and productive terminal environment with ZSH, Oh-My-Zsh, and essential plugins.

30 min setup time
Beginner-Intermediate
Updated July 2, 2025

Prerequisites

Before You Begin

Make sure you have the following before proceeding with this guide:

A Unix-based Operating System

macOS, Linux, or Windows with WSL (Windows Subsystem for Linux)

Basic Command Line Knowledge

Familiarity with basic terminal commands and navigation

Administrative Access

Ability to run commands with sudo privileges

Git

Git should be installed on your system

Internet Connection

Required to download packages and plugins

Note for Windows Users

If you're on Windows, we recommend setting up WSL2 (Windows Subsystem for Linux) before proceeding with this guide. Check our WSL2 Setup Guide for detailed instructions.

Installing ZSH

ZSH (Z Shell) is a powerful shell that offers numerous improvements over the standard Bash shell, including better tab completion, spelling correction, and a more customizable prompt.

Installation Instructions by Platform

macOS comes with ZSH pre-installed since macOS Catalina (10.15). To verify if it's installed, run:

zsh --version

If you need to install it manually, you can use Homebrew:

brew install zsh

To set ZSH as your default shell, run:

chsh -s $(which zsh)
macOS Terminal with ZSH

macOS Terminal showing ZSH version check

Verification

After installation, verify ZSH is working by opening a new terminal window and running echo $SHELL. It should output /bin/zsh or similar.

Setting Up Oh-My-Zsh

Oh-My-Zsh is a framework for managing your ZSH configuration. It comes bundled with thousands of helpful functions, helpers, plugins, and themes.

Installation

Install Oh-My-Zsh using curl or wget:

Using curl:

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

Using wget:

sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Oh-My-Zsh Installation

Oh-My-Zsh installation process

Configuration File

Oh-My-Zsh creates a .zshrc file in your home directory. This is the main configuration file for ZSH and Oh-My-Zsh.

# Open .zshrc file in your preferred editor
nano ~/.zshrc

# Or with VS Code
code ~/.zshrc

The .zshrc file contains various settings including:

  • Theme selection
  • Plugin configuration
  • Environment variables
  • Aliases and functions
  • Path configurations

Tip

After making changes to your .zshrc file, you need to reload it for changes to take effect. You can do this by running source ~/.zshrc or by restarting your terminal.

Essential Plugins

Oh-My-Zsh plugins enhance your terminal experience with additional functionality. Here are some must-have plugins for developers:

Syntax Highlighting

Provides syntax highlighting for commands as you type them, making it easier to spot errors before executing commands.

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

Then add zsh-syntax-highlighting to your plugins list in .zshrc

Autosuggestions

Suggests commands as you type based on your command history, making it faster to execute frequently used commands.

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

Then add zsh-autosuggestions to your plugins list in .zshrc

Git

Provides many aliases and functions for Git commands, making Git operations faster and more efficient.

This plugin is included with Oh-My-Zsh by default. Just add git to your plugins list in .zshrc.

Example: gst for git status, gco for git checkout

Z (Jump Around)

Tracks your most visited directories and allows you to quickly jump to them using fuzzy matching.

This plugin is included with Oh-My-Zsh by default. Just add z to your plugins list in .zshrc.

Example: z projects will take you to your most frequently visited directory containing "projects"

Configuring Plugins

To enable plugins, edit your .zshrc file and update the plugins line:

plugins=(
  git
  z
  zsh-autosuggestions
  zsh-syntax-highlighting
  # Add more plugins here
)

After updating the plugins list, reload your configuration:

source ~/.zshrc
ZSH Plugins in Action

ZSH with syntax highlighting and autosuggestions plugins

Pro Tip

For the best experience, load zsh-syntax-highlighting as the last plugin in your list. This ensures that it can properly highlight all commands, including those added by other plugins.

Theme Customization

Oh-My-Zsh comes with over 100 themes to customize your terminal's appearance. You can also customize your prompt to display useful information like Git status, current directory, and more.

Choosing a Theme

To change your theme, edit your .zshrc file and update the ZSH_THEME variable:

ZSH_THEME="robbyrussell"  # Default theme
# Other popular themes:
# ZSH_THEME="agnoster"
# ZSH_THEME="powerlevel10k/powerlevel10k"
# ZSH_THEME="spaceship"
robbyrussell Theme

robbyrussell (Default)

Simple and clean theme with Git status information.

ZSH_THEME="robbyrussell"
agnoster Theme

agnoster

A popular theme with powerline-style prompt and Git integration.

ZSH_THEME="agnoster"
powerlevel10k Theme

powerlevel10k

Highly customizable theme with fast load times and extensive information.

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

# Then set:
ZSH_THEME="powerlevel10k/powerlevel10k"
spaceship Theme

spaceship

Minimalist and powerful theme with async Git status and language version info.

# First install:
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

# Then set:
ZSH_THEME="spaceship"

Customizing Your Prompt

You can customize your prompt by creating your own theme or modifying an existing one. Here's an example of customizing the prompt directly in your .zshrc file:

# Set ZSH_THEME to empty to use custom prompt
ZSH_THEME=""

# Custom prompt configuration
PROMPT='%{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$fg[red]%}❯%{$fg[yellow]%}❯%{$fg[green]%}❯ %{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"

Fonts for Themes

Some themes (like agnoster and powerlevel10k) require special fonts with powerline symbols. We recommend installing a Nerd Font like Meslo Nerd Font for the best experience.

Color Schemes

In addition to themes, you can customize your terminal's color scheme. Most terminal emulators allow you to import color schemes:

Dracula
Nord
Solarized
Monokai

Productivity Shortcuts

ZSH and Oh-My-Zsh provide numerous shortcuts and features to boost your productivity. Here are some essential ones to learn:

Shortcut Description Example
Navigation
Ctrl + A Move cursor to beginning of line -
Ctrl + E Move cursor to end of line -
Alt + B Move cursor backward one word -
Alt + F Move cursor forward one word -
Editing
Ctrl + U Delete from cursor to beginning of line -
Ctrl + K Delete from cursor to end of line -
Ctrl + W Delete word before cursor -
Alt + D Delete word after cursor -
History
Ctrl + R Search command history Press Ctrl+R and type part of a previous command
!! Repeat last command sudo !! to run previous command with sudo
!$ Use last argument of previous command mkdir dir && cd !$
Directory Navigation
cd - Go to previous directory -
z keyword Jump to frequently used directory (requires z plugin) z projects
d Show recently used directories Type number to jump to that directory
ZSH Specific
Tab Enhanced tab completion Press Tab twice for interactive selection
** Recursive path expansion ls src/**/*.js

Useful Aliases

You can add custom aliases to your .zshrc file to create shortcuts for frequently used commands:

# Add these to your .zshrc file

# General shortcuts
alias c="clear"
alias ll="ls -la"
alias zshconfig="nano ~/.zshrc"
alias ohmyzsh="nano ~/.oh-my-zsh"
alias reload="source ~/.zshrc"

# Git shortcuts
alias gs="git status"
alias ga="git add"
alias gc="git commit -m"
alias gp="git push"
alias gl="git pull"

# Directory shortcuts
alias projects="cd ~/projects"
alias docs="cd ~/Documents"

# Application shortcuts
alias code="code-insiders" # If you use VS Code Insiders

Productivity Tip

Create aliases for your most commonly used commands and directories. This can save you thousands of keystrokes over time and make your workflow much more efficient.

Troubleshooting

Here are solutions to common issues you might encounter when setting up and using ZSH and Oh-My-Zsh:

Common Mistake to Avoid

Don't delete or rename the .oh-my-zsh directory. This contains all the framework files and your customizations. If you need to reset your configuration, it's better to rename your .zshrc file and let Oh-My-Zsh create a new one.

Additional Resources

Downloadable Files

Get our pre-configured files to jumpstart your terminal setup:

Video Tutorials

Complete ZSH & Oh-My-Zsh Setup Tutorial

10 ZSH Productivity Tricks You Need to Know

Community Support

Have questions or need help? Join our community channels:

Conclusion

Congratulations! You've now set up a powerful and customized terminal environment with ZSH and Oh-My-Zsh. Your new setup will help you work more efficiently and make your command-line experience more enjoyable.

What You've Learned

  • How to install and configure ZSH and Oh-My-Zsh
  • Setting up essential plugins for enhanced functionality
  • Customizing your terminal's appearance with themes
  • Productivity shortcuts and aliases to speed up your workflow
  • Troubleshooting common issues and finding additional resources
Back to Dev Tools