- Plugins -

My Top 6 Essential Zsh Plugins

|
3 min read
My Top 6 Essential Zsh Plugins

I've been using Zsh for a while now, and I've been using it for my daily work. With countless plugins and themes available, it can be overwhelming to choose the right ones. I've compiled a list of the top 6 essential Zsh plugins that I use every day.

Plugins:

  1. Git Plugin
  2. Zsh-autosuggestions Plugin
  3. Zsh-syntax-highlighting Plugin
  4. Autojump Plugin
  5. You-Should-Use Plugin
  6. Zsh-bat Plugin

1. Git Plugin

The git plugin comes bundled with Oh My Zsh and offers a collection of convenient aliases and functions for Git.

Instead of typing lengthy commands like git push origin "current_branch", you can simply type ggp

Typing one long command occasionally isn't a hassle. However, we interact with Git frequently as developers, and we spend a lot of time typing commands. That adds up in the long run, so why not save a few strokes? 😁😁😁

My most commonly used Git aliases are:

  • gst - alias for git status
  • gss - alias for git status -s
  • ga - alias for git add .
  • gco - alias for git checkout
  • gcb - alias for git checkout -b
  • ggp - alias for git push origin $(current_branch)
  • ggpull - alias for git pull origin "$(git_current_branch)"

However, you can see all the available aliases here.

In case you want to create custom aliases, you can do so by adding them in the .zshrc file. Checkout my .zshrc configuration file if you want to see my custom aliases.


2. Zsh-autosuggestions Plugin

The zsh-autosuggestions plugin predicts and suggests command as you type, based on your history and completions. This feature saves time and reduces the number of keystrokes.

Zsh Autosuggestion Example

Installation with Oh My Zsh:

  1. Clone the plugin repository:
  1. Add the plugin to your .zshrc file:
  1. Reload your Zsh configuration:

3. Zsh-syntax-highlighting Plugin

The zsh-syntax-highlighting plugin provides syntax highlighting for your command line input, making it easier to spot errors and understand command structures.

Zsh Syntax Highlighting Example

Installation with Oh My Zsh:

  1. Clone the plugin repository:
  1. Add the plugin to your .zshrc file:
  1. Reload your Zsh configuration:

4. Autojump Plugin

Navigating deep directory structures can be time-consuming. The autojump plugin allows you to quickly jump to frequently used directories using a simple command.

How It Works:

Autojump tracks the directories you use most and assigns them a ranking. To jump to a directory, use:

zsh-autojump.webp

For example:

This command takes you to the most frequently accessed directory matching "projects".

Installation:

  • macOS (using Homebrew):
  • Ubuntu/Debian:

After installing, add autojump to your plugins in .zshrc:

Reload your Zsh configuration:

Note: Make sure to spend some time navigating directories so Autojump can learn your usage patterns.


5. You-Should-Use Plugin

Remembering all your aliases can be challenging. The you-should-use plugin reminds you of existing aliases when you type out the full command, helping you adopt shortcuts more consistently.

zsh-you-should-use.webp

Installation with Oh My Zsh:

  1. Clone the plugin repository:
  1. Add the plugin to your .zshrc file:
  1. Reload your Zsh configuration:

Now, when you type a command that has an alias, you'll receive a friendly reminder.


6. Zsh-bat Plugin

Upgrade your cat command with zsh-bat, which leverages the bat command to display file contents with syntax highlighting and Git integration.

Installation Steps:

  1. Install bat:
  • macOS (using Homebrew):
  • Ubuntu/Debian:

Note: On some systems, the bat command might be named batcat.

  1. Install the zsh-bat plugin:
  1. Add to your .zshrc file:
  1. Reload your Zsh configuration:

Now, using cat will automatically display files with enhanced readability.

Conclusion

By incorporating these plugins into your Zsh setup, you'll significantly improve your command line efficiency and enjoy a more streamlined development experience.

Keep coding, keep exploring, and keep inspiring. 🐼

Written By Anuz Pandey

Anuz Pandey is a multi-disciplinary designer and developer with a passion for creating visually stunning and user-friendly digital experiences. He has been working in the industry for over 5 years. He is currently working as a freelance designer and developer and is available for hire.

Tags

  • zsh
  • plugins

Related Blogs

No blogs found.