Install ZSH (Oh My Zsh) on Ubuntu 20.04 LTS with syntax-highlighting

If you want to see a nice console like below then this article is for you.

  • As usually we will update/upgrade all packages
sudo apt-get update
sudo apt-get upgrade
  • Install ZSH
sudo apt-get install zsh
  • Install needed packages for ZSH to display correctly fonts
sudo apt-get install powerline fonts-powerline
  • Clone the Oh My Zsh Respo
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  • Create a New ZSH configuration file
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  • Set up a Fancy theme for your Terminal – Open .zshrc File using nano editor
nano .zshrc
  • Find the line ZSH_THEME="robbyrussell" replace robbyrussell with agnoster theme in .zshrc
ZSH_THEME="agnoster"
  • Change your Default Shell
chsh -s /bin/zsh
  • Install ZSH Syntax Highlighting for Oh My Zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
  • Add syntax-highlighting in .zshrc Configuration
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"
  • Make reboot
sudo reboot

BONUS “Bash completion”

If you don’t have installed bash completion, I really recommend you to install it.

sudo apt-get install bash-completion

In the end you need just to use a “Tab” to have auto bash completion

2 thoughts on “Install ZSH (Oh My Zsh) on Ubuntu 20.04 LTS with syntax-highlighting”

  1. Hi Alexander,

    Thank you, I could easily set up the zsh highlighting. Would you mind doing another tutorial on zsh autojump and auto suggestions? Because I tried to set them up with differents tutorial, but it was unsuccessful.

    Thanks,

    1. Thank you Ramakers for your comment and I am very glad that my experience was useful for you. Could you please maybe give me more input about your wish? Because In the end of the article you can find – BONUS “Bash completion” – and it is about what you mean. It is very easy, only one command to install it and it will work.

Leave a Reply

Your email address will not be published.