I’ve been using ZSH for years now as my shell. In that time, I’ve learned a few niceties to make the experience better. Namely, I’ve found the minimal oh-my-zsh prompt keeps out of the way and the git aliases super convenient. Plugins for autosuggestions, like in the fish shell, and syntax highlighting are also quite helpful. Antigen makes keeping plugins up-to-date a breeze.

Tutorial

This tutorial explains how to install ZSH and set it as your default shell on Ubuntu 20.04. Plus, it details how to install and configure Antigen, oh-my-zsh, autosuggestions, and syntax highlighting.

  1. Install ZSH.[1]

    $ sudo apt install -y zsh
  2. Add /usr/bin/zsh to /etc/shells so that is can be used as the default shell.[2]

    $ command -v zsh | sudo tee -a /etc/shells
    /usr/bin/zsh
  3. Set the default shell to zsh.

    $ chsh -s `which zsh`
    Changing shell for jordan.
    Password:
    Shell changed.
  4. Now, open up a fresh terminal session to start using .

  5. Download and install Antigen.[3] There is a bug in the debian package at this time, so manually download and install it.[4]

    $ wget -q git.io/antigen
    $ sudo mkdir /usr/share/zsh-antigen
    $ sudo mv antigen /usr/share/zsh-antigen/antigen.zsh

    When the bug is fixed, you can simply install the package with Aptitude as follows.

    $ sudo apt install -y zsh-antigen
  6. Create the .antigenrc configuration file.[5]

    ~/.antigenrc
    # Load the oh-my-zsh library
    antigen use oh-my-zsh
    
    antigen bundles <<EOBUNDLES
        # Bundles from the default repo (robbyrussell's oh-my-zsh)
        git
    
        # Fish-like auto suggestions
        zsh-users/zsh-autosuggestions
    
        # Extra zsh completions
        zsh-users/zsh-completions
    
        # Syntax highlighting bundle.
        zsh-users/zsh-syntax-highlighting
    EOBUNDLES
    
    # Load the theme
    antigen theme robbyrussell
    
    # Tell antigen that you're done
    antigen apply
  7. Now, from the .zshrc file load Antigen and the .antigenrc configuration file.

    ~/.zshrc
    # Load Antigen
    source /usr/share/zsh-antigen/antigen.zsh
    
    # Load Antigen configurations
    antigen init ~/.antigenrc
  8. Load the updated .zshrc configuration file.

    $ source ~/.zshrc
  9. Update the plugins as needed.[6]

    $ antigen update

Conclusion

You should now be able to install and configure ZSH as your default shell in Ubuntu. You should also be able to setup Antigen to use oh-my-zsh and a couple of convenient plugins. If you want to automate updating your Antigen plugins with systemd, checkout the post Automatically Update Antigen.