DEV Community

Cover image for Your Terminal Deserves Better. Oh My Zsh Agrees.
Maksym
Maksym

Posted on

Your Terminal Deserves Better. Oh My Zsh Agrees.

You wouldn't write code in Notepad. So why are you still using a bare-bones shell? Oh My Zsh transforms your terminal from a blinking cursor into a genuinely productive environment -- one that autocompletes intelligently, surfaces git context at a glance, and makes you wonder how you ever lived without it.

If you caught the earlier piece on Fish shell, welcome back. Fish is opinionated and batteries-included by design. Zsh with Oh My Zsh takes a different approach: more configurable, a deeper ecosystem, and fully POSIX-compatible. Two great shells, two different philosophies. This is the other side of the coin.


What is Oh My Zsh?

Oh My Zsh is an open-source, community-driven framework for managing your Zsh configuration. It was born in 2009 from a single developer's frustration with their .zshrc. Today it ships with over 300 plugins and 150 themes, maintained by a community that has been iterating on shell ergonomics for fifteen years.

Think of it as a package manager for your shell personality. One install unlocks tab completion that actually works, inline git status in your prompt, syntax highlighting as you type, autosuggestions from history, and enough theme options to lose an afternoon.


Installation

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

That is it. The installer backs up your existing .zshrc, installs Oh My Zsh, and drops you into a configured shell. No manual setup required.


Plugins worth enabling

Plugins are activated by editing the plugins array in your ~/.zshrc:

plugins=(git z docker zsh-autosuggestions zsh-syntax-highlighting)
Enter fullscreen mode Exit fullscreen mode

Restart your shell (or run source ~/.zshrc) and the changes take effect immediately.

git

The most-used plugin. Provides over 50 aliases for common operations:

Alias Expands to
gst git status
gco git checkout
glog git log --oneline --decorate --graph
gp git push
gl git pull

Type alias | grep "^g" in your shell after enabling to see the full list.

z

Tracks the directories you visit and lets you jump to any of them by typing a fragment of the path. No more cd ../../projects/client-name/repo -- just z repo.

z proj      # jumps to ~/code/projects
z dot       # jumps to ~/.dotfiles
Enter fullscreen mode Exit fullscreen mode

zsh-autosuggestions

Displays ghost-text suggestions based on your command history as you type. Press the right arrow key to accept a suggestion. This one plugin alone eliminates a large fraction of keystrokes in a typical session.

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

zsh-syntax-highlighting

Colors your command as you type it. Valid commands appear in green. Unrecognized commands and typos appear in red -- before you press Enter, so you catch mistakes immediately.

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

Both zsh-autosuggestions and zsh-syntax-highlighting require a manual clone step because they are third-party plugins not bundled with Oh My Zsh.


Themes

The active theme is set with a single line in ~/.zshrc:

ZSH_THEME="robbyrussell"
Enter fullscreen mode Exit fullscreen mode

The default theme (robbyrussell) is clean and fast. It shows your current directory and git branch, nothing more. For most setups it is a sensible starting point.

If you want more information density in your prompt, the community has converged on Powerlevel10k as the gold standard.

Powerlevel10k

Powerlevel10k renders asynchronously, meaning your prompt stays responsive even when git or other tools are slow to respond. It surfaces git status, last exit code, command execution time, current time, and more -- all configurable through an interactive setup wizard.

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

# Activate in ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
Enter fullscreen mode Exit fullscreen mode

The first time you open a new shell after enabling it, the configuration wizard launches automatically. It walks you through a series of visual tests and preference questions, then writes a ~/.p10k.zsh file. The whole process takes about five minutes.


Zsh vs Fish

Since Fish shell was covered in a previous piece, it is worth stating plainly: both are excellent tools, and the right choice depends on what you value.

Fish gives you smart features -- autosuggestions, syntax highlighting, web-based config -- out of the box with near-zero configuration. It is opinionated by design and works well as a result.

Zsh with Oh My Zsh is a different trade-off. It requires a little more initial setup, but gives you a deeper plugin ecosystem, full POSIX compatibility (meaning shell scripts written for bash will generally work), and a community that has been accumulating tooling for over a decade.

Many developers install both and choose based on the machine or context. There is no wrong answer.


A starter ~/.zshrc

export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="powerlevel10k/powerlevel10k"

plugins=(
  git
  z
  docker
  zsh-autosuggestions
  zsh-syntax-highlighting
)

source $ZSH/oh-my-zsh.sh

# Personal aliases
alias ll="ls -lAh"
alias gs="git status"
alias reload="source ~/.zshrc"
Enter fullscreen mode Exit fullscreen mode

After saving, run source ~/.zshrc to apply the changes without opening a new terminal window.


Where to go from here

The official plugin list lives at ~/.oh-my-zsh/plugins/ -- browse the folder to see what is available without any additional installs. For third-party plugins, the Awesome Zsh Plugins repository is a well-maintained directory.

Oh My Zsh is not magic. It is fifteen years of collective developer frustration turned into very good defaults. Install it once, spend an hour making it yours, and you will not look at a stock terminal the same way again.

Top comments (0)