Quick Links
Unlock the full power of your Linux or macOS terminal with Zsh and Oh My Zsh, letting you transform your command line with smart autocompletion, customizable themes, and powerful plugins. Boost productivity and streamline your workflow with this dynamic duo.
What Is Oh My Zsh?
Normally, your Linux or macOS terminal uses Bash by default, but there areplenty of other command shellsto choose from. While Bash is fine and most people don’t think twice about it,Z Shell (or Zsh) improves upon Bashin many ways.Oh My Zsh or OMZgoes even further by simplifying Zsh configuration and automating tasks, while providing athriving support community.
Install Zsh and Oh My Zsh
To install OMZ, you need to execute one simple command, but to do so you need to install Zsh and Git first. Here’s how to set it all up across different Linux systems and macOS. If you already have Zsh and Git installed, you’re able to skip to the OMZ install command.
macOS
You can install OMZ on macOS but you first need toinstall Homebrew (brew) first. Brew isa package manager similar to apt, dnf, and pacman, which allows you to install stuff on Mac just like you would on a Linux distribution.
Now you’re able to install Zsh and Git.

Install OMZ.
As it installs, OMZ should ask you to switch your default shell to Zsh (you can always switch back to Bash later) and then automatically restart your prompt.
Basic Customizations
The default Zsh configuration file (.zshrc) is pretty extensive but its mostly stuff you’ll never need and a lot of commented text.
To make things simple, let’s start over with a new configuration file and some very basic options. First, back up your existing .zshrc file.

Using your preferred text editor (we’re using vim, but you can use nano, pico, or whatever you prefer), create a new .zshrc file.
Next, type or paste the following:

Save your new .zshrc file and restart your terminal or type zsh.
More Customizations
Why stop here? There’s so much more you may do to really trick out your command prompt!
More Theme Options
As we pointed out, assigning a new theme is as simple as specifying it in the .zshrc. If you don’t know what theme you want to use, or you want OMZ to surprise you, you can set ZSH_THEME=“random”. Then, every time you open your terminal or type zsh, OMZ will load a different theme.
If you find a handful of themes you like, and you want to load them randomly, then add the following lines.

If you don’t know what theme you want, you can check outthe full list of themesthat every Oh My Zsh installation includes.
Install More Plugins
The git plugin is the basic go-to plugin that every OMZ configuration should have, butthere are many others that you can try. Here are four more that you might want to know about.
Zsh-Autosuggestions:This suggests commands as you type, which are based on your history and the commands you use the most. When command you want appears, you can enter the right arrow to complete it.

To install this plugin, enter the following command:
Zsh-Syntax-Highlighting and Zsh-Fast-Syntax-Highlighting:These plugins highlight commands as you type, using colors to indicate valid syntax and errors. To install these plugins:
While these plugins basically do the same thing, Zsh-Fast-Syntax-Highlighting is designed to be faster in complex or highly customized environments. If in doubt, choose Zsh-Syntax-Highlighting over Zsh-Fast-Syntax-Highlighting for its stability and maturity, and broader compatibility with various Zsh setups.

Zsh-Autocomplete: This plugin enhances tab completion (enter Tab to complete a command) by providing a dropdown selection of commands including flags and directory locations (if you use the cd command). To install this plugin:
Whether you install one or all of these plugins, you’ll need to enable them in your .zshrc.
Then save the file, exit the editor, and restart your terminal.
Other Useful Options
Here are just a few more options you might consider when creating your custom .zshrc.
Modify History Behavior
You can configure your command prompt to handle and display command history differently. For example, these following options configure Zsh history by setting the log file to ~/.zsh_history, limiting history size to 10,000 commands, and ensuring duplicates and commands starting with a space are ignored, with new commands appended rather than overwriting the file.
Case-insensitive Tab Completion
You can enable case-insensitive tab completion, so you can type commands and complete them with TAB without worrying about the case.
setopt nocasematch
Autocorrection
Some people don’t like typo autocorrection, and some do. If you’re part of the latter, you’re able to enable autocorrection.
Removing Oh My Zsh
If you decide that OMZ isn’t for you, you can remove it, and even switch your shell prompt back to bash.
Remove Oh My Zsh and rename the .zshrc file.
If you prefer to just get rid of everything altogether, then you can remove the .zshrc file.
Congratulations on successfully installing and configuring Oh My Zsh on your system! This is a huge step towards enhancing your terminal experience and boosting your productivity. Oh My Zsh unlocks a wide variety of plugins, themes, and other smart customizations that make your command line more efficient and enjoyable. Hopefully, you now feel confident exploring more plugins, tweaking your configuration, and making your terminal your own!