DEV Community

MUHAMMED YAZEEN AN
MUHAMMED YAZEEN AN

Posted on • Updated on

Exploring Zsh and Its Powerful Plugins: A Guide to Supercharge Your Terminal Experience

Zsh, an upgraded version of the Bourne Shell, brings several new features like automatic cd (change directory), spell correction, themes, and plugins.

ZSH

 

Installation:

1) Installation: Open your terminal and enter the following command to install Zsh:

sudo apt install zsh

Enter fullscreen mode Exit fullscreen mode

2) Set Zsh as Your Default Shell: Make Zsh your default shell using:

chsh -s /bin/zsh

Enter fullscreen mode Exit fullscreen mode

3) Log out first, then reopen the terminal.

 

.zshrc

The .zshrc File: Your Personalized Shell Guidebook

The .zshrc file acts as a manual for your Zsh shell, allowing you to customize your shell environment. You can create shortcuts (aliases), modify your prompt's appearance, and add extra features (plugins) through this file.

zshrc is typically located in the user's home directory.

1) To edit the zshrc

gedit ~/.zshrc

Enter fullscreen mode Exit fullscreen mode

2) To reload your shell to apply changes made in the .zshrc file.

exec .zshrc

Enter fullscreen mode Exit fullscreen mode

 

Introducing Oh My Zsh:

ZSH website

Oh My Zsh is a tool that makes using the Zsh shell easier and more customizable. It provides a collection of themes, plugins, and functions that enhance your command-line experience. In simple words, it's like a toolbox that helps you customize and improve how you interact with your computer using the command line.

Installation Guide for Oh My Zsh

To install Oh My Zsh, simply visit the official website and locate the provided script. Copy this script, then open your terminal and paste it there to initiate the installation process

 

Must-Have Plugins

Oh My Zsh opens the door to a universe of plugins, each catering to specific needs and enhancing your workflow. Here are some essential plugins to consider:

1. Git: Streamlining Version Control

This plugin provides many aliases and functions that make working with Git from the command line easier.

Usage:

For detailed usage, you can refer to the official documentation.

Installation:

1) The git plugin comes bundled with Oh My Zsh.
2) To install it, append git to the plugin list in your .zshrcfile in your home directory.

plugins=( 
    git
)
Enter fullscreen mode Exit fullscreen mode

2. Sudo

The sudo plugin helps to add 'sudo' in front of previous commands by pressing the escape button twice.

Installation:

  1. The sudo plugin comes bundled with Oh My Zsh.
  2. To install it, append sudo to the plugin list in your .zshrcfile in your home directory.
plugins=( 
    sudo
)
Enter fullscreen mode Exit fullscreen mode

3. Zsh-autosuggestions

This plugin provides fish-like autosuggestions for zsh.

Installation:

1) First, clone the zsh-autosuggestions repository into ~/.oh-my-zsh/custom/plugins.

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Enter fullscreen mode Exit fullscreen mode

2) Then, append zsh-autosuggestions to the plugin list in your .zshrc file in your home directory.

plugins=( 
    zsh-autosuggestions
)
Enter fullscreen mode Exit fullscreen mode

4. History

This plugin provides several commands to work with your command history.

Usage:

h: Prints your command history.
hs: Use grep to search your command history.
hsi: Use grep to do a case-insensitive search of your command history.

Installation:

1) The history plugin comes bundled with Oh My Zsh.
2) To install it, append history to the plugin list in your .zshrc file in your home directory.

plugins=( 
    history
)
Enter fullscreen mode Exit fullscreen mode

5. Copypath

The copypath plugin allows you to copy the current directory path to your system clipboard.

Installation:

1) The copypath plugin comes bundled with Oh My Zsh.
2) To install it, append copypath to the plugin list in your .zshrc file in your home directory.

plugins=( 
   copypath
)
Enter fullscreen mode Exit fullscreen mode

6. Copyfile

The copyfile plugin allows you to copy the contents of a file to your system clipboard.

Installation:

1) The copyfile plugin comes bundled with Oh My Zsh.
2) To install it, append copyfile to the plugin list in your .zshrc file in your home directory.

plugins=( 
   copyfile
)
Enter fullscreen mode Exit fullscreen mode

7. Copybuffer

The copybuffer plugin lets you copy the current command line to your system clipboard.

Installation:

  1. The copybuffer plugin comes bundled with Oh My Zsh.
  2. To install it, append copybuffer to the plugin list in your .zshrc file in your home directory.
plugins=( 
   copybuffer
)
Enter fullscreen mode Exit fullscreen mode

8. Dirhistory

The dirhistory plugin provides commands for navigating directory history.

Installation:

  1. The dirhistory plugin comes bundled with Oh My Zsh.
  2. To install it, append dirhistory to the plugin list in your .zshrc file in your home directory.
plugins=( 
   copybuffer
)
Enter fullscreen mode Exit fullscreen mode

9. JsonTools

The jsonTools plugin provides commands for validating and formatting JSON.

Installation:

  1. The jsonTools plugin comes bundled with Oh My Zsh.
  2. To install it, append jsonTools to the plugin list in your .zshrc file in your home directory.
plugins=( 
   jsonTools
)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)