Skip to content
Go back

Zsh Setup with Auto-Suggestions, Syntax-highlighting & Themes

Published:

Install Zsh

sudo apt update
sudo apt install zsh

Make Zsh your default shell

chsh -s $(which zsh)

Install Oh My Zsh

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

Install and Configure zsh-autosuggestions, syntax-highlighting

Now let’s install the zsh-autosuggestions plugin, which provides command auto-suggestion based on your history.

  1. Clone the plugin repository:

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  2. Enable the plugin in your .zshrc file: Open your ~/.zshrc file using a text editor (e.g., nano, vim, code):

    nano ~/.zshrc

    Find the line that starts with plugins=(...). By default, it usually looks something like plugins=(git).

    Add zsh-autosuggestions and syntax-highlighting to the list of plugins. It should look like this:

    plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

    You can add other plugins later as you discover them.

  3. Find Available Themes (Optional)

Oh My Zsh has a dedicated wiki page listing all its built-in themes with screenshots. This is the best place to browse and see what they look like:

You can also find them locally in your system:

ls ~/.oh-my-zsh/themes/*.zsh-theme

This command will list all the theme files, but it won’t show you previews. The wiki page is much more useful for selection.

Some popular themes include:

Save and exit the .zshrc file.


Reload your Zsh configuration

For the changes to take effect, you need to reload your ~/.zshrc file.

source ~/.zshrc


Suggest Changes

Previous Post
Setting Static IP using nmtui on vmware workstation.
Next Post
Linux Command Line and Shell Scripting Cheat Sheet for Beginners and Practitioner