Z Shell or ZSH is a popular alternative shell to the typical BASH shell. It is a powerful shell that is known for its enhanced usability and features. There are many different themes and plugins that anyone could utilize to build a shell that exactly meets their needs.

That is where Oh My Zsh comes into play. It is a very popular framework for managing your ZSH configuration and comes bundled with thousands of helpful functions, helpers, plugins and themes.

The last piece of the puzzle is the theme that we’ll be using for ZSH, which is powerlevel10k. It is a theme that emphasized speed, flexibility and an excellent out-of-the-box experience.

Let’s get started on setting it all up!

Install and Configure ZSH

First, we have to install ZSH:

sudo apt-get update
sudo apt-get install zsh

Make sure that it is correctly installed:

zsh --version

Change the default shell for the current user:

chsh -s $(which zsh)

Enter the password for the current user to change the default shell.

Reboot your system and open the terminal.

You will be prompted for the new configuration.

Press 0 to create an empty config file, .zshrc, since it will be populated my Oh My Zsh

Install Oh My Zsh

Install Oh My Zsh with the following command:

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

This will use the existing empty .zshrc file created earlier to customize ZSH.

The default theme that is initially set is robbyrussell and the other defaults are stored in the ~/.oh-my-zsh/themes directory but we will be updating it to powerlevel10k. 🥳

Install and Setup Powerlevel10k

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

The command will download the theme into the ~/.oh-my-zsh/themes directory.

To change the default theme, edit the .zshrc file and set ZSH_THEME="powerlevel10k/powerlevel10k".

Apply the changes by reloading the ZSH configuration

source .zshrc

The next time you open up the terminal the powerlevel10k configuration wizard will guide you through a series of questions and configure your prompt. If it doesnt trigger automatically, you can type p10k configure. Additional cutomization can be done by editing the ~/.p10k.zsh file which was created by the configuration wizard.

Enabling Custom Plugins

There is a huge amount of plugins that expand the functionality of ZSH and Oh My Zsh has an excellent variety of different kinds. You can see the full list here or in the ~/.oh-my-zsh/plugins directory.

To enable a plugin, edit the zshrc config file and add the plugin name where it says plugins=()

Apply the changes

source .zshrc

You can now use the plugins but make sure to check out the documentation for each one.

And there we have it, you should now be in a good position to continue customizing to your heart’s content!