↓Skip to main content
  1. Writings/

I tried Oh My Zsh to give my Debian terminal a much-needed makeover

·4 mins
feature image for the article containing terminal with ohmyzsh

I’ve always liked customizing my Linux desktop, but somehow, I’ve never paid much attention to the terminal. I’ve mostly stuck with the default Bash shell, which, while perfectly functional, isn’t particularly exciting to look at.

Recently, I came across Oh My Zsh, a popular open-source framework for customizing the Zsh shell. It comes with a bunch of themes, plugins, and other features that let you personalize your command-line experience.

I decided to give it a try on my Debian machine, and setting it up turned out to be pretty straightforward.

What is Oh My Zsh? #

Before getting started, there’s a small distinction worth understanding. Zsh (Z Shell) is a Unix shell, much like Bash, that offers several improvements, including better autocomplete, customization options, and interactive features.

Oh My Zsh, on the other hand, is a community-driven framework built on top of Zsh. It makes managing themes, plugins, and other shell configurations considerably easier.

Think of it as a way to get more out of your existing terminal without having to configure everything from scratch.

“ohmyzsh website homepage”

First, let’s get the fonts right #

Before installing Oh My Zsh, there’s one more thing worth taking care of: your terminal font.

Since I wanted to use the Agnoster theme, I needed a font that could display its special symbols and Powerline characters correctly. For this, I went with MesloLG Nerd Font.

You can download it from the Nerd Fonts website. Once downloaded, extract the archive and install the font files on your Debian machine.

Next, open your terminal preferences and change the custom font to MesloLGM Nerd Font. The exact steps will depend on which terminal emulator you’re using.

“changing default font to meslo fonts”

That’s it! Your terminal is now ready for any theme you throw at it.

Installing Oh My Zsh on Debian #

First, we need to install Zsh, since Oh My Zsh depends on it. Thankfully, Debian has it available in its default repositories.

Open your terminal and run:

sudo apt install zsh curl git

“installing dependencies for ohmyzsh”

Once installed, make Zsh your default shell:

chsh -s "$(command -v zsh)"

“changing shell to zsh”

You’ll need to log out and back in for the change to take effect.

Now comes the fun part. Installing Oh My Zsh is as simple as running this command:

sh -c "$(curl -fsSL https://install.ohmyz.sh)"

“running ohmyzsh setup script”

That’s it! The installer takes care of setting everything up, including creating the necessary configuration files in your home directory.

“ohmyzsh installed successfully”

Customizing the terminal with themes and plugins #

This is where Oh My Zsh starts getting interesting. It comes with a collection of themes and plugins that you can enable through its configuration file, ~/.zshrc.

Themes #

Themes change how your shell prompt looks. You can find several built-in options, ranging from minimal prompts to more elaborate ones displaying Git information, directories, and other details.

To change your theme, open the configuration file:

nano ~/.zshrc

Look for the ZSH_THEME setting and replace its existing value with your preferred theme.

For example:

ZSH_THEME="robbyrussell"

changing theme from robbyrussell to agnoster""

Save the file and reload your configuration:

source ~/.zshrc

“reloading shell to apply new theme”

Plugins #

Plugins are another reason Oh My Zsh is worth exploring. They add useful functionality and shortcuts to your shell.

You can enable built-in plugins by adding their names to the plugins list in your .zshrc file.

For example:

plugins=(git debian)

“already installed plugins”

Oh My Zsh also supports third-party plugins. Two particularly useful ones are zsh-autosuggestions and zsh-syntax-highlighting.

The former suggests commands based on your shell history as you type, while the latter adds syntax highlighting to your commands, making it easier to spot mistakes before executing them.

You can install both using Git:

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

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

“clone new plugins from github”

Then add them to your plugins list:

plugins=(
  git
  debian
  zsh-autosuggestions
  zsh-syntax-highlighting
)

“Add two new plugins in zshrc file”
Make sure zsh-syntax-highlighting stays at the end of the list. Reload your configuration, and you’re good to go.

Is Oh My Zsh worth trying? #

I think so. If you spend a reasonable amount of time working in the terminal, having a shell that looks the way you want and offers a few additional conveniences is a nice improvement.

Of course, Oh My Zsh isn’t going to completely change how you use Linux, nor do you need dozens of plugins to make it useful. Even a simple theme and a couple of plugins can make the experience considerably more pleasant.

I’m still exploring its themes and plugins, but it’s been a nice little upgrade to my otherwise ordinary Debian terminal.