Why Zsh Plugins?
Zsh is the default shell on macOS and increasingly popular on Linux. The base install is good. With the right plugins, it becomes significantly faster to use.
Setup: Oh My Zsh or Zinit?
Two main approaches:
Oh My Zsh — popular, easy, but slow to load (many plugins bundled, even unused ones):
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Zinit — modern, fast, lazy-loads plugins:
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
This guide covers both approaches.
Plugin 1: zsh-autosuggestions
The single most impactful plugin. As you type, it shows the most recent matching command in grey. Press → to accept.
# Oh My Zsh:
# Add 'zsh-autosuggestions' to plugins=() in ~/.zshrc
# Zinit:
zinit light zsh-users/zsh-autosuggestions
# Manual:
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
After install, complete commands with → key or Ctrl+F.
Plugin 2: zsh-syntax-highlighting
Colors your commands as you type — valid commands appear green, invalid ones red, paths appear underlined:
# Oh My Zsh:
# Add 'zsh-syntax-highlighting' to plugins=()
# Zinit:
zinit light zsh-users/zsh-syntax-highlighting
# IMPORTANT: must be loaded LAST in your .zshrc
Instantly see typos before pressing Enter. The visual feedback is invaluable.
Plugin 3: zsh-completions
Adds completions for hundreds of additional commands (Docker, kubectl, npm, git, AWS, etc.):
# Oh My Zsh (already includes many completions)
# Install for additional ones:
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
# Add 'zsh-completions' to plugins=()
# Zinit:
zinit light zsh-users/zsh-completions
Tab-complete Docker commands, kubectl resource names, git branches — without memorizing every flag.
Plugin 4: fzf Integration
fzf is a fuzzy finder. When integrated with zsh, it supercharges Ctrl+R (history search), Ctrl+T (file search), and Alt+C (directory jump):
# Install fzf
brew install fzf
$(brew --prefix)/opt/fzf/install
# This adds keybindings automatically to your .zshrc
After install, Ctrl+R becomes an interactive fuzzy history search instead of incremental reverse search.
Plugin 5: zoxide (Smart cd)
Learns which directories you visit and lets you jump to them with partial names:
# Install
brew install zoxide
# Add to .zshrc:
eval "$(zoxide init zsh)"
# Usage:
z src # Jump to the most frecent directory matching "src"
z my-project # Jump to matching project directory
zi # Interactive selection with fzf
Replace cd entirely after a week of training it.
Plugin 6: Fast Prompt with Starship
Starship is a cross-shell prompt that shows git status, language versions, and more — without slowing down:
# Install
brew install starship
# Add to END of .zshrc:
eval "$(starship init zsh)"
# ~/.config/starship.toml — customize what shows
[git_branch]
symbol = "🌿 "
[nodejs]
format = "via [⬢ $version](bold green) "
[directory]
truncate_to_repo = true
Starship renders in milliseconds — unlike some Oh My Zsh themes that add 200ms+ to every prompt.
Plugin 7: history-substring-search
Type part of an old command and press ↑ to search backward for matching commands:
# Oh My Zsh:
# Add 'history-substring-search' to plugins=()
# Then bind it:
# bindkey '^[[A' history-substring-search-up
# bindkey '^[[B' history-substring-search-down
# Zinit:
zinit light zsh-users/zsh-history-substring-search
Type git and press ↑ to cycle through only git commands from your history.
Minimal .zshrc with Zinit
# ~/.zshrc
# Zinit initialization
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
# Plugins
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-history-substring-search
# Must be last:
zinit light zsh-users/zsh-syntax-highlighting
# Tools
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Your aliases
source ~/.aliases # or paste aliases directly here
Key Takeaways
- zsh-autosuggestions — most impactful plugin, suggests commands as you type
- zsh-syntax-highlighting — colors commands in real-time, catches typos
- fzf — transforms
Ctrl+Rhistory search into fuzzy interactive search - zoxide — replaces
cdwith frequency-aware directory jumping - Starship — fast, informative prompt without shell startup slowdown
- Use Zinit over Oh My Zsh for faster shell startup (lazy loading)