# Install Zsh and Auto suggestion plugin for Ubuntu

**Published:** February 16, 2021
**Tags:** Shell

**Summary:** 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...


---

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`:

```shell
sudo apt install zsh -y
```

Set Zsh as the default shell:

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

```shell
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.

```shell
git clone https://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.

```shell
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

- Oh My Zsh: [https://ohmyz.sh/](https://ohmyz.sh/).
- Install zsh-autosuggestions [https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md](https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md).

