zsh

How to use themes on ZSH

ZSH is a powerful shell you can customize to suit a wide variety of needs.

NOTE: If you would like to know the basics of ZSH and its configuration, consider reading our tutorial on how to go about editing the .zshrc file for ZSH.

Other than its flexibility, ZSH supports frameworks, allowing you to expand its functionality using functions, plugins, and themes. In this quick guide, we will discuss how to install the oh-my-zsh framework and install ZSH themes.

Before installing and configuring themes, the first step is to ensure you have the ZSH shell installed.

Install ZSH and oh-my-zsh

Use the apt package manager to perform the installation.

sudo apt-get update
sudo apt-get install zsh

Once you have the ZSH shell installed on your system, you can make it the default shell by running the command:

chsh -s $(which zsh)

The next step is to set up oh-my-zsh, a framework that makes working with ZSH easier and more enjoyable.

Use the command below to install oh-my-zsh. Note that this will automatically download and install oh-my-zsh with no prompt. You can manually read the script and see what it does.

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

This command installs oh-my-zsh and activates the default theme. By default, it comes prepackaged with a collection of themes that you can activate by editing the .zshrc file in your home directory.

To view the list of all themes that come installed by default, browse the ~/.oh-my-zsh/themes directory. You can also visit the main oh-my-zsh themes wiki below:

https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

Once you find the theme that appeals to you, you can set it by editing the ~/.zhsrc file in the entry ZSH_THEME=”name”

For example, to change the theme from default “robbyrussell” to another theme such as “cypher,” edit the config as:

ZSH_THEME="cypher"

You will need to launch a new terminal session for changes to apply.

Conclusion

This quick tutorial has shown you how to install ZSH and the oh-my-zsh framework to customize ZSH quickly.

If you would like to learn how to customize your shell manually, please refer to the ZSH man and documentation to learn more.

Thanks for reading!

About the author

John Otieno

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list