AICurious Logo
Published on
Tuesday, February 16, 2021

Install Zsh and Auto suggestion plugin for Ubuntu

316 words2 min read
Authors

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:

sudo apt install zsh -y

Set Zsh as the default shell:

chsh -s $(which zsh)

Step 2 - Install Oh My Zsh

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

sh -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.

git 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.

nano ~/.zshrc

Before:

plugins=(git)

After:

plugins=(git zsh-autosuggestions)

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

References