DEV Community

Cover image for Supercharge Your Mac Terminal: A Step-by-Step Guide to iTerm2, Oh My Zsh & Powerlevel10k
Gabe Perez
Gabe Perez

Posted on

Supercharge Your Mac Terminal: A Step-by-Step Guide to iTerm2, Oh My Zsh & Powerlevel10k

Setting up my new Mac today, I found myself once again configuring my development environment. Like many developers, I started my journey with the default macOS terminal thinking, "This works fine." But after discovering the power of a properly configured development environment, it transformed my daily workflow. I decided to document the entire process, hoping it might help others setting up their Mac for development. This guide will help you create a modern, feature-rich terminal environment that will make you more productive and – dare I say it – make terminal work enjoyable.

Screenshot of the resulting iTerm
Time to Complete: 15-20 minutes
Compatibility: Works on both Intel and Apple Silicon Macs
Skill Level: Beginner to Advanced

Quick Start (TL;DR)

For those who just want to get going, here are all the commands in order. If you're new to terminal customization, I recommend following the detailed guide below instead.

Ultra-Quick Setup (for the brave)

# One-liner setup (review the script contents first!)
curl -fsSL https://raw.githubusercontent.com/perezgb/mac-terminal-setup/refs/heads/main/setup.sh | bash
Enter fullscreen mode Exit fullscreen mode

Standard Quick Setup

# 1. Backup existing configuration
cp ~/.zshrc ~/.zshrc.backup 2>/dev/null || echo "No existing ~/.zshrc"

# 2. Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 3. Install iTerm2
brew install --cask iterm2

# 4. Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 5. Install Powerlevel10k theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed -i '' 's/ZSH_THEME="robbyrussell"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc

# 6. Install essential plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
brew install autojump

# 7. Restart terminal or reload configuration
source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

screenshot of the result of running all commands

Quick Verification ✓

After running the quick setup, verify everything is working:

# Check Oh My Zsh
echo $ZSH_VERSION
# Check Powerlevel10k
p10k
# Check plugins
echo $plugins
Enter fullscreen mode Exit fullscreen mode

Screenshot of the result of the verification commands

Before We Begin

What You'll Need

  • About 15-20 minutes of your time
  • Basic familiarity with terminal commands (but don't worry, we'll explain each step)
  • A cup of coffee (optional, but recommended ☕)

What You'll Get

  • A modern, fast terminal with split-screen capability
  • Smart command history search
  • Syntax highlighting as you type
  • Intelligent directory navigation
  • Git status information in your prompt
  • Auto-suggestions based on your command history

Backup Strategy

Before we start, let's ensure we can recover if needed:

# Backup existing configurations
cp ~/.zshrc ~/.zshrc.backup 2>/dev/null || echo "No existing ~/.zshrc"
cp ~/.p10k.zsh ~/.p10k.zsh.backup 2>/dev/null || echo "No existing ~/.p10k.zsh"
Enter fullscreen mode Exit fullscreen mode

Installing Homebrew

Homebrew installs the stuff you need that Apple didn’t.

If you haven't installed it yet, run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Note: You might be asked for your password. This is normal – macOS needs your permission to install system-wide tools.

Step 1: Installing and Configuring iTerm2

iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.14 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted.

Installation

brew install --cask iterm2
Enter fullscreen mode Exit fullscreen mode

Initial Setup

After installing iTerm2:

  1. Open iTerm2 (you can find it in your Applications folder)
  2. Press ⌘, (Command + Comma) to open Preferences
  3. Let's make it comfortable to use:
    • Go to 'General > Window'
    • Check 'Native full screen windows'
    • Under 'Profiles > Default':
      • Set 'Window Size' to 140x40 (this gives you plenty of space to work)

iTerm2 settings

Step 2: Setting Up Oh My ZSH

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...

Installation

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

Note: If you see a prompt asking to make zsh your default shell, type 'Y' and press Enter.

Step 3: Installing Powerlevel10k Theme

Why Powerlevel10k?

Powerlevel10k makes your terminal:

  • Show helpful information (like git branch and status)
  • Look modern and professional
  • Feel faster and more responsive

Installation Steps

  1. Install the theme:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Enter fullscreen mode Exit fullscreen mode
  1. Set up the theme:
# Open your zsh configuration file in TextEdit (if you prefer)
open -e ~/.zshrc

# Or use the terminal to make the change
sed -i '' 's/ZSH_THEME="robbyrussell"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc
Enter fullscreen mode Exit fullscreen mode
  1. Restart iTerm2 or run:
source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Configuring Powerlevel10k

When you restart iTerm2, you'll see the Powerlevel10k configuration wizard. The wizard will:

  • Check if you have the required fonts
  • Help you install them if needed
  • Guide you through customizing your prompt

Follow the wizard's recommendations for the best experience. I suggest:

  • Yes to all powerline symbols
  • Unicode character set (better compatibility)
  • Dark color scheme (easier on the eyes)
  • Classic prompt style (clean and professional)
  • Yes to transient prompt (saves space)
  • Yes to instant prompt (faster startup)

If the wizard doesn't start automatically, type p10k configure and press Enter.

Step 4: Essential Plugins

Let's add three must-have plugins that will make your terminal experience much better:

1. Zsh Autosuggestions

This plugin suggests commands as you type, based on your history:

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

2. Zsh Syntax Highlighting

Makes your commands colorful and helps spot mistakes:

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

3. Autojump

Lets you jump to directories by typing j and part of the directory name:

brew install autojump
Enter fullscreen mode Exit fullscreen mode

Setting Up the Plugins

Open your configuration file:

open -e ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Find the plugins= line and update it to:

plugins=(
    git                         # Git shortcuts and features
    zsh-autosuggestions        # Fish-like autosuggestions
    zsh-syntax-highlighting    # Fish-like syntax highlighting
    autojump                   # Smart directory jumping
)
Enter fullscreen mode Exit fullscreen mode

Note: You can also edit this file directly in the terminal using nano ~/.zshrc if you prefer.

Essential Shortcuts You Now Have

After completing the setup, you'll have these powerful shortcuts available:

  • Ctrl + R: Fuzzy search through command history
  • Ctrl + T: Fuzzy find files in current directory
  • j previous_directory: Jump to previously visited directory
  • gs: Git status (example of Oh My Zsh's git shortcuts)
  • Take folder_name: Create and cd into a directory
  • Cmd + D: Split iTerm2 pane vertically
  • Cmd + Shift + D: Split iTerm2 pane horizontally
  • Cmd + ] / Cmd + [: Navigate split panes

Troubleshooting FAQ

  1. Q: The Powerlevel10k configuration wizard isn't starting!

    A: Run p10k configure manually

  2. Q: My prompt looks wrong or has missing symbols!

    A: Run p10k configure and follow the font installation steps

  3. Q: A plugin isn't working!

    A: Verify installation and configuration:

   ls ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/
   # Check .zshrc plugins section
   open -e ~/.zshrc
Enter fullscreen mode Exit fullscreen mode
  1. Q: How do I uninstall everything? A: Run these commands:
   # Uninstall Oh My Zsh
   uninstall_oh_my_zsh
   # Remove iTerm2
   brew uninstall --cask iterm2
   # Restore original configuration
   cp ~/.zshrc.backup ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Next Steps

Congratulations! You now have a modern, powerful terminal setup.

How's your new terminal looking? Share a screenshot in the comments below! And if you have any questions or run into issues, feel free to ask in the comments.

Top comments (0)