Skip to content
Hogin Hogin
Go back

A Minimal Zsh Setup on macOS

Updated:
2 мин чтения

Zsh is a powerful, customizable shell that replaces the default bash on macOS.

With a couple of simple steps you can improve autocompletion, syntax highlighting, and overall comfort when working in the terminal.

1. Installing Zsh and the basic plugins

Open the terminal and install the required packages:

brew install zsh
brew install zsh-autosuggestions zsh-syntax-highlighting

Homebrew is a package manager for macOS. If it isn’t installed, run:

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

2. Installing Oh My Zsh

Oh My Zsh is a framework on top of Zsh that makes working with plugins and themes easier.

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

After installation, a new terminal session opens with the robbyrussell theme (the default).

3. Configuring .zshrc

Open the configuration file:

nano ~/.zshrc

Add or verify the following lines:

# Oh My Zsh standard section
plugins=(git kubectl)

# Autosuggestions
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh

# Syntax highlighting
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Important: the line with zsh-syntax-highlighting must come last, otherwise highlighting may not work.

4. Installing the Powerlevel10k theme (optional)

Powerlevel10k is a modern, fast theme for Zsh with support for icons, Git status, and system information.

Installation:

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

Add to .zshrc:

ZSH_THEME="powerlevel10k/powerlevel10k"

After saving the file, run:

source ~/.zshrc

On first launch, Powerlevel10k offers an interactive configuration of its appearance.

You can run it again at any time:

p10k configure

Tip: install fonts with icon support (for example, MesloLGS NF) and select them in your terminal.

5. Applying the changes

Restart the terminal or run:

source ~/.zshrc

6. Verifying it works

Done!

Now you have a configured, fast, and informative Zsh shell

with autocompletion, highlighting, and handy plugins.

Try typing kubectl get p — if a pods suggestion appears, then everything works!


Share this post:

Previous Post
20 Cybersecurity Tools for 2025
Next Post
MDT Deployment & Administration. Part 3: Creating a New Task Sequence