This post was originally posted here
ZSH (or Z Shell), is an extended version of the default shell. It includes new features, themes and plugins.
We can install it from the default shell using:
apt install zsh
Oh-my-zsh is a framework that runs on top of ZSH. If you want to understand it from a web example, it would be something like this: ZSH is Javascript and oh-my-zsh is React/Angular/Vue/etc.
From their site:
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things (...)
We can simply install it with a one-liner. Via cURL:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Or via Wget:
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
We accept changing our default shell to zsh, enter our password and that's it:
Note: As you can see, the ~ symbol indicates that zsh is being used. But if we close the terminal and open it again, the default shell will be used.
We can now run '$ zsh' to enable it, or simply logout/login and the default shell will be zsh.
If the change didn't work and we still have the default shell running, run:
sudo chsh -s $(which zsh) $(whoami)
ohmyzsh comes with a lot of plugins and themes preinstalled. I'll be showing you how to customize it using my current preset.
First, we install powerline font to have support for icons in our terminal:
sudo apt install fonts-powerline
Then, we change the default theme 'robbyrussell' to agnoster. This one is pretty common because it's optimized for git repository usage.
sudo nano ~/.zshrc
And change ZSH_THEME variable to ZSH_THEME="agnoster".
To remove the username and host from the prompt, modify:
sudo nano ~/.oh-my-zsh/themes/agnoster.zsh-theme
And comment 'prompt_context' like below:
If you followed the previous steps, you'd have something like this (using Solarized Dark theme for the terminal):