After following these steps, your terminal will look like:
Zsh is a shell designed for interactive use, although it is also a powerful scripting language.
Run sudo apt install zsh
Verify installation by running zsh --version
Make it your default shell: chsh -s $(which zsh)
Log out and login back again to use your new default shell.
Test that it worked with echo $SHELL
. Expected result: /bin/zsh
or similar.
Reference: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.
Requirements:
Run sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Inspect the install script by running:
$ curl -Lo install.sh https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
$ sh install.sh
Reference: https://github.com/ohmyzsh/ohmyzsh
Fonts Powerline contains pre-patched and adjusted fonts for usage with the Powerline statusline plugin.
For Ubuntu:
Run sudo apt install fonts-powerline
For MacOS:
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts
Then, we change the default theme 'robbyrussell' to 'agnoster'. This one is pretty common because it's optimized for git repository usage.
Run sudo nano ~/.zshrc
and change ZSH_THEME variable to "agnoster" like below:
ZSH_THEME="agnoster"
To remove the username and host from the prompt, run:
sudo nano ~/.oh-my-zsh/themes/agnoster.zsh-theme
And comment 'prompt_context' like below:
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_aws
# prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_end
}
References:
https://github.com/powerline/fonts
https://dev.to/nicoh/installing-oh-my-zsh-on-ubuntu-362f
This plugin has the capability for command completion. It suggests commands based on your command history.
Navigate to the plugins folder and clone the git repository:
$ cd ~/.oh-my-zsh/custom/plugins
$ git clone https://github.com/zsh-users/zsh-autosuggestions
This plugin has the capability to verify the correctness of your command.
Navigate to the plugins folder and clone the git repository:
$ cd ~/.oh-my-zsh/custom/plugins
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting
Finally, add both plugins to the plugins list. Run sudo nano ~/.zshrc
and change it like below:
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
Reference: https://medium.com/wearetheledger/oh-my-zsh-made-for-cli-lovers-installation-guide-3131ca5491fb
Have fun!
super