Install Zsh and Auto suggestion plugin for Ubuntu

ZSH, also called the Z shell, is an extended version of the Bourne Shell (sh), with plenty of new features, and support for plugins and themes. Since it's based on the same shell as Bash, ZSH has many of the same features, and switching over is a breeze.

This short tutorial guide you to install zsh and auto-suggestions plugin for Ubuntu and replace the original shell bash. This is my favorite setup for shell.

Step 1 - Install Zsh

Install Zsh using apt:

1sudo apt install zsh -y

Set Zsh as the default shell:

1chsh -s $(which zsh)

Step 2 - Install Oh My Zsh

Oh My Zsh is an open source, community-driven framework for managing your Zsh configuration.

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

Step 3 - Install zsh-autosuggestions

Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands as you type based on history and completions.

1git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

Enable autosuggestions: Open ~/.zshrc, find the line starting with plugins= add zsh-autosuggestions into.

1nano ~/.zshrc

Before:

1plugins=(git)

After:

1plugins=(git zsh-autosuggestions)

You need to logout and login again, or restart your PC after this step.

References

Related Posts

How do I install Ubuntu on a new machine?

Viet-Anh maintains this note as an instruction to install Ubuntu on a new machine and setup development environment as fast as possible.

Read more

Install OpenCV 4 on macOS using Homebrew

This is my note on how to install OpenCV 4 on macOS with Homebrew. I tested this tutorial on my Macbook Air 2020 with Apple silicon (M1 chip).

Read more

My development environment on macOS - Macbook Air M1

I maintain this note as my instruction for setting up macOS for development. Currently, I apply this on my Macbook Air M1 2020 - 16GB RAM and 512GB SSD.

Read more