Skip to main content
Using Zsh

7 Awesome Zsh Plugins

Let me share some of my favorite Zsh plugins.

β€” Sagar Sharma

Warp Terminal

Out of the box, zsh lacks features and polish to win over new users as it looks super plain and does not even store command history 😩.

So what do you do in that case? Simple. Install zsh plugins as they will make your terminal look appealing and help you with your productivity as well.

But the internet is flooded with hundreds of plugins and most of them are made by developers for their personal use only. So what I did here is hand-picked the top 7 zsh plugins for you!

πŸ“‹
I am not including the installation steps for the plugins here. You can use Oh My Zsh or install them directly. The steps can be found on their respective repositories.

1. Syntax highlighting

Syntax highlighting in zsh

Syntax highlighting is one of the most useful plugins of zsh as it uses different colors to indicate commands, arguments, variables, operators, and other elements.

The best part is you get to know that the command you are about to execute is faulty and you should re-read the command.

To make things easy, I also wrote a detailed guide covering how to enable syntax highlighting in zsh:

Enable Syntax Highlighting in Zsh
Improve your Zsh experience by enabling syntax highlighting. Here’s how to do that.

2. Auto suggestions

use auto suggestions in zsh

The auto-suggestion plugin in zsh will highlight the remaining commands based on the command history.

For more options, you can press the up and down arrow key which will traverse you through the similar commands you executed in the past.

If you don't find the command you were looking for, then you can type it further until the perfect match is shown.

Once you find the command you were looking for, press the right arrow key and then press the Enter key!

history substring search plugin in zsh

Looks like auto-suggestion? Nope. This one is a little better at finding commands from history.

The history substring search plugin lets you search through the command history by simply typing a part of the command that you wish to find.

Unlike the auto-suggestion where it only shows the remaining part of the typed command, the history substring search will take the part of the command you wrote and will match it to the entire history of commands.

0:00
/0:06

There are times when you immediately want to search for something on the web while working on the terminal and not everyone is comfortable with the terminal-based browsers.

In that case, you can use the web search plugin which will simply open the default web browser of your system showing the search results.

That's what you call convenience 😌.

The only downside is it is only available for the Oh My Zsh users and if you do use Oh My Zsh, then it does not require any installation and can be enabled just by mentioning the plugin name in the plugin section.

5. Copyfile

0:00
/0:10

It is an Oh My Zsh extension that copies the file contents to a system clipboard with a single command.

Before enabling the extension, make sure you install xclip and xsel as they are the core dependencies for this plugin to work. If you're on Ubuntu, you can use the following:

sudo apt install xclip xsel

Once done, it can be directly added to your Oh My Zsh's plugin line.

6. Z

jump between recent directories in zsh using the z plugin

The Z plugin is used to quickly jump between recently visited directories. Z keeps a database of how long you were inside a specific directory and also keeps track of how frequently you change directories.

The more you use it, the better it gets.

The best part is at one time you can be inside of a directory inside your home directory and in a blink of an eye you can jump a specific directory inside of a root directory.

It is more of an "I didn’t think I needed lotion until I used some, and now I need it."

7. Zsh-autoswitch-virtualenv

If you work with Python virtual environments then you're going to love this utility.

The zsh-autoswitch-virtualenv is a simple zsh plugin that lets you switch Python virtualenvs automatically as you move between directories.

When enabled, it automatically detects and activates your Pipenv and Poetry projects without any extra steps.

πŸ“‹
Before using this plugin, make sure you create an alias in zsh for python="pyhon3".

Once after created the alias, you can use this plugin to make your life easier.

Here are 3 essential tweaks for zsh

Out of the box, zsh looks plain and doesn't do anything special. So we wrote a detailed guide on how to customize zsh on Linux covering syntax highlighting, autosuggestion, Oh My Zsh, and Powerlevel10k:

Install and Setup ZSH on Ubuntu Linux
Want a cool looking Linux terminal? Try Zsh. Learn how to set up Zsh on Ubuntu Linux with Oh My Zsh.

I hope you will find this guide helpful.

Sagar Sharma