Fundamentals 7 min read

Transform Your macOS Terminal with iTerm2, oh‑my‑zsh, and Custom Themes

This step‑by‑step guide shows how to install iTerm2, set up oh‑my‑zsh, import attractive color schemes, switch to the agnoster theme, configure Powerline fonts, and enable hot‑keys and useful shortcuts for a more powerful and visually appealing terminal experience.

Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Transform Your macOS Terminal with iTerm2, oh‑my‑zsh, and Custom Themes

Effect

Below is the author’s preferred terminal appearance, demonstrating a visually appealing theme; many other color schemes and themes are also available.

iTerm2

iTerm2 is a more powerful replacement for the default macOS Terminal.

item2: https://www.iterm2.com/

After installation, the window looks similar to the default Terminal, but with a black background.

oh‑my‑zsh

Installing oh‑my‑zsh actually installs the Zsh shell, which provides attractive themes (default is

robbyrussell

).

Run the following command to install:

<code>sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"</code>

After installation the terminal changes appearance.

Color Scheme

Clone the color‑scheme repository or download the zip:

git clone

Repository: https://github.com/mbadolato/iTerm2-Color-Schemes

In iTerm2 open Preferences (

cmd + ,

) → Profile → Colors → Color Presets → Import and select a scheme (e.g.,

Atom

).

After importing, choose

Atom

to apply.

Theme

Set the Zsh theme to

agnoster

by editing

.zshrc

:

<code># Open .zshrc file
vim ~/.zshrc</code>

Change

ZSH_THEME

to

agnoster

and save (

:wq

).

Reload Zsh (

zsh

) or restart iTerm2; the theme changes but may show garbled characters.

Install Powerline fonts to fix the issue:

<code># clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean‑up
tcd ..
rm -rf fonts</code>

Then select a Powerline‑compatible font in iTerm2 (Preferences → Profile → Text → Change Font), e.g.,

Roboto Mono for Powerline

.

More Convenient Layout

Disable the native full‑screen option (General → Window → Native Full Screen Windows) and set the window style to

Full‑Width Top of Screen

(Profile → Window → Style).

After restarting iTerm2, the terminal appears at the top of the screen; press

cmd + enter

to toggle full‑screen.

Hot Key

Configure a global hot‑key (e.g.,

option + i

) in Preferences → Keys → Hotkey to quickly show or hide iTerm2.

Shortcut Keys

Useful shortcuts include:

cmd + enter

: toggle iTerm2 size

Hotkey

: show/hide iTerm2

cmd + d

: split pane vertically

cmd + D

: split pane horizontally

cmd + t

: open new tab

control + u

: clear current input

control + a

: move cursor to line start

control + e

: move cursor to line end

control + b

: move cursor backward

control + f

: move cursor forward

cmd + 1,2,3,4

: switch tabs

option + 1,2,3,4

: switch split panes

macOSoh-my-zshcolor schemeshotkeysiTerm2Powerline fontsterminal customization
Tencent IMWeb Frontend Team
Written by

Tencent IMWeb Frontend Team

IMWeb Frontend Community gathering frontend development enthusiasts. Follow us for refined live courses by top experts, cutting‑edge technical posts, and to sharpen your frontend skills.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.