Boost your Terminal with Zsh extensions
Sep 8, 2024
Zsh or Z Shell is a powerful customizable shell that providers plenty features out of the box. And what makes it powerful is its extensions and plugins along with some cli tools. Making the terminal experience more efficient and enjoyable.
Before We Start:
-
This guid is going to use the Oh-My-Zsh which is:
Oh My Zsh is an open source, community-driven framework for managing your Zsh configuration
Oh-My-ZshTo install it you can use wget or curl:
- wget:
- curl:
-
I will use Debian as my OS, all installation scripts will only work on Debian based linux distributions (Don't worry I'll include the official websites & installations if you are not using Debian based Linux distributions).
Zsh Plugins
For Lazy People Like me:
I will Include a Github Repository for automated installation process in
the end of the section. So feel free to skip the manual installation.
-
zsh-autosuggestions
It suggests commands as you type based on history and completions.
zsh-autosuggestions- Use the right arrow key to complete the command.
To install it you have to run the following command.
Then you will need to add to the list of plugins in the
.zshrc
file, typically It is located in the home directory~/.zshrc
. Open it with any text editor and add the plugin like this:Then you have to start a new terminal session.
You can also restart it with a single command:
-
zsh-syntax-highlighting
This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.
zsh-syntax-highlightingThe same procedure is followed. Run the command:
Then add it to plugins list:
Finally restart the terminal session to activate it.
-
Autocomplete for Zsh
This plugin for Zsh adds real-time type-ahead autocompletion to your command line, similar to what you find desktop apps. While you type on the command line, available completions are listed automatically; no need to press any keyboard shortcuts.
PressTab
to insert the top completion or↓
to select a different one.
Autocomplete for Zsh-
You can navigate through the suggestions using the arrow keys and use
Tab
To select one:
To install I will provide the way i installed it if It did not work check the official installation guide.
Then add it to the plugins list:
And lastly restart the terminal session.
-
-
zsh-history-substring-search
This is a clean-room implementation of the Fish shell's history search feature, where you can type in any part of any command from history and then press chosen keys, such as the UP and DOWN arrows, to cycle through matches.
zsh-history-substring-searchTo install it run the following:
Then add it to the plugins list:
And also restart the terminal session:
Automated Installation script
Here is a GitHup Repository created by me to automate the process. The Repository called dot-zsh.
It Includes Two parts:
- Oh-My-Zsh Installer.
- Plugins Installer.
Here is how to use it:
-
Clone the Repository
Clone this repository to your local machine:
-
Run the Installation Script
Execute the
install.sh
script to install Oh-My-Zsh, plugins, set up.zshrc
, and make zsh the default shell -
Install Plugins only
If you already installed Oh-My-Zsh, You can directly install the plugins by running the
install-plugins.sh
script instead of theinstall.sh
script:
Conclusion
These are the plugins that I personally use daily.
Make sure to check out the official documentation for each plugin to see the customizations and the tweaks that you can make.
I will be updating this post whenever I find my self using a new plugin. See you around :)