Getting started with ZSH and Oh My ZSH Theme

ZSH used together with Oh My ZSH themes improves your workflow, moral and avoid straining over the terminal.

Getting started with ZSH and Oh My ZSH Theme
Oh My ZSH

Oh, my zsh themes have been my personal favorites when it comes to terminal customization. Unlike traditional shells such as bash that are hard to customize, zsh can be customized using oh my zsh themes. This has led to me personally switching from using bash to zsh.

When setting up my Linux environment the first thing I usually do is switch my Linux terminal shell from bash to zsh, apply a dark profile, and set up the oh my zsh theme.

A brief history of zsh

In 1990 a student named Paul Falstad at Princeton University started the development of zsh. He derived ZSH from the name of his professor Zhong Shao, a Yale Professor who was then a teaching assistant at Princeton University. Paul Falstad wrote zsh shell in C programming language and it was intended to be a subset of of csh for the Commodore Amiga.
At the moment zsh is no longer maintained by Paul Falstad. Over the years the zsh project has had rapid development, getting contributions from developers all over the world and outgrowing its intended purpose. The zsh project has morphed to a point where it's a worthy competitor to bash shell.
Notable zsh successes include:

  • In 2019 Apple switched from bash shell to zsh shell as the default shell.
  • In 2020 Kali Linux adopted zsh as the default shell.

Apple switched from bash shell to zsh shell

For a while, Macs have been shipping with outdated bash, bash v3.2 released in 2007. This is due to licensing issues. Bash v3.2 was released under GPLv2, however, the coming versions of bash after bash v3.2 updated their license to GPLv3. Apple didn't seem to agree with the GPLv3 license hence they stuck to bash v3.2. Until 2019 when they made the decision to switch to zsh. This is partly because zsh is released under an MIT license.

The zsh shell has its advantages over the traditional bash shell. These include:

  • Better autocompletion compared to bash.
  • Easier scrolling through history commands you run earlier by filtering if you remember the first words you typed
  • Better inbuilt commands that make your development workflow easier. For example, instead of running mkdir Example && cd Example on zsh shell, you can just run take Example
  • Easily customizable using themes such as oh my zsh themes.

Installing zsh

On Debian based systems you can install zsh using the "apt" application manager. On Mac's if not installed as default shell you can use "brew" application manager

sudo apt install zsh
Debian Install ZSH
brew install zsh
Installing ZSH using Brew

Depending on your system below is a link with a guide on how to install zsh on your system.

Installing ZSH · ohmyzsh/ohmyzsh Wiki
🙃 A delightful community-driven (with 2,100+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, pyth...

Installing Oh My ZSH Theme

You can install oh my zsh theme using two methods, curl and wget.

💡
Before installing oh my zsh themes ensure you have git installed on your system. Oh My zsh themes usesgit to download/clone the package.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install Oh My ZSH theme using Curl
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
Install Oh My ZSH theme using wget

During installation, you are usually asked if you would want to set zsh as your default shell. Say yes, if you however skipped this step you can set zsh as the default shell using the below command.

chsh -s $(which zsh) 
set zsh as default shell on Linux
💡
Don't run the above command as root.

Setting/Change Oh My ZSH Theme

In order to change zsh theme edit the .zshrc file usually located at your home directory.

nano ~/.zshrc
change zsh theme

Change the line ZSH_THEME="<theme-name>" to a theme of your choice. All supported themes can be found in the below link.

Themes · ohmyzsh/ohmyzsh Wiki
🙃 A delightful community-driven (with 2,100+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, pyth...

Activate Oh My ZSH theme without logging out

In order to activate oh my zsh theme without logging out  run the below command.

source ~/.zshrc
Activate zsh without logging out
Top 10 Best Oh My ZSH Themes for Developers
Oh My ZSH themes have gained popularity over the years by being the most preferred terminal theme among developers.

Conclusion

Oh My ZSH themes offer a variety of terminal themes that make the developers experience lovable. On the other hand ZSH shell offers features that present advanced usage of bash. Basically ZSH shell is like bash shell on steroids.

If your a developer who has never tried ZSH shell, I would highly recommend you try zsh shell with oh my zsh theme. As it would not only improve your workflow but boost your moral and avoid straining over the terminal.

Subscribe to Bluedoa Digest

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
alexander@example.com
Subscribe