In today’s tutorial, I want to show you how to install ZSH, make it the default shell and install the oh-my-zsh framework to customize and add more functionality to your shell using plugins.
Let us get started:
How to Install ZSH and Oh-My-ZSH Framework
ZSH is a popular shell usually available in the repositories of major Linux distributions. To install it, use your default package manager. For this example, I will use the apt package manager:
sudo apt-get install zsh -y
Next, run ZSH for the initial setup and create a .zshrc config file.
To make ZSH your default shell, use the chsh command as:
Installing the oh-my-zsh framework is easy as executing a single line of command. If you want to know what the installer script does, you can download and review it, then execute it once you’re comfortable. Otherwise, use either of the commands below to install it:
To use cURL, enter the command:
Once you have oh-my-zsh is installed and activated, you can start customizing it by editing the .zshrc file in your home directory.
How to Activate Plugins
By default, oh-my-zsh comes packaged with a collection of plugins that you can activate to suit your needs. Some of them are simple aliases, but others are complex. The following link has a list of all supported plugins.
Once you find a plugin you wish to use, activate it by adding it to the plugin() array in the .zshrc file. For example, to activate the python, Vscode, git, and wp-CLI plugins, add the entries as shown below:
Save the file and source the .zshrc file to load the changes or launch a new shell session.
ZSH and Oh-my-zsh have a dedicated community that is constantly releasing new plugins, themes, and functions to make working with the shell easier. Feel free to visit the community forums to explore ways to customize your shell to fit your needs.