Setting up Zsh with Oh-My-Zsh on macOS

Set up a beautiful terminal on macOS using WezTerm, Zsh, Oh-My-Zsh, and Powerlevel10k.


Before Starting

Supported Installation

This installation procedure is tested on macOS Sequoia (15.x) with Apple Silicon, but should be compatible with other macOS versions.

Installation

Install Homebrew

If you haven't installed Homebrew yet, run the following command:

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

Install WezTerm

WezTerm is a GPU-accelerated cross-platform terminal emulator and multiplexer.

brew install --cask wezterm

Install Nerd Fonts

Install MesloLGS NF font for the best Powerlevel10k experience.

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

Install Zsh

macOS comes with Zsh, but it's recommended to install the latest version via Homebrew.

brew install zsh

Set Zsh as your default shell:

chsh -s $(which zsh)

Install Oh My Zsh

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

Install Powerlevel10k

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

Set ZSH_THEME="powerlevel10k/powerlevel10k" in your ~/.zshrc.

Configuration

Configure WezTerm

Create a configuration file at ~/.wezterm.lua with the following content to use the installed font and remove the window decoration.

~/.wezterm.lua
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
 
config.font = wezterm.font 'MesloLGS NF'
config.window_decorations = "RESIZE"
 
return config

Configure Powerlevel10k

Restart your terminal. The Powerlevel10k configuration wizard should start automatically. If it doesn't, run:

p10k configure

Choose your favorites configuration!

My personal favorite configs are: 3121132342221y1y (Start from "Prompt Style")

Install Plugins (Optional)

Zsh-Completions
Additional completion definitions for Zsh.

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

Zsh-Autosuggestions
It suggests commands as you type based on history and completions.

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

Zsh-Syntax-Highlighting
It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal.

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

Finally, add the following configuration to .zshrc:

plugins=(
  git
  zsh-completions 
  zsh-autosuggestions 
  zsh-syntax-highlighting
)

Apply the changes by executing source ~/.zshrc.