- Published on
My top Zsh plugins to boost your productivity
- Authors

- Name
- Hoang Nguyen

1. What is Zsh?
Zsh, short for Z Shell, is a Unix shell built on top of the Bourne Shell (sh) with many improvements and new features. Released in 1990 by Paul Falstad, Zsh was designed for interactive use, although it is also a powerful scripting language.
2. What is Oh My Zsh?
Oh My Zsh is an open source, community-driven framework for Zsh (Z Shell) configuration management. It is one of the most popular and widely used tools to enhance the Zsh command line interface with themes, plugins and useful functions, making it powerful, flexible and user-friendly. more user-friendly

3. My top Zsh plugins to boost your productivity
3.1. Git
What?
The Git plugin in Oh My Zsh is one of many plugins available that come with the Oh My Zsh framework, designed to enhance the Zsh command line interface. This particular plugin provides many aliases, functions, and utilities for Git operations, making working with Git from the command line easier and faster. By simplifying common Git commands into shorter aliases, it helps improve your workflow and productivity.
Why?
Simplifies Complex Commands Improves Efficiency Enhances Workflow
How?
- Enable the Git Plugin: To enable the Git plugin, you need to edit your ~/.zshrc file (the configuration file for Zsh). You can open this file in a text editor by running nano ~/.zshrc or vim ~/.zshrc in your terminal.
- Locate the Plugins Section: Inside the .zshrc file, look for the plugins= line. It might already have some plugins listed between the parentheses.
- Add the Git Plugin: Add git to the list of plugins inside the parentheses. Ensure that each plugin is separated by a space. For example, if you're also using the npm and docker plugins, your line might look like this:
plugins=(git)
- Save and Apply Changes: Save the changes to your .zshrc file and exit the text editor. To apply the changes, either restart your terminal or run source ~/.zshrc to reload your Zsh configuration.
- Using Git Aliases: Once the Git plugin is enabled, you can start using the aliases it provides. For example, instead of typing git status, you can simply type gst. For git commit, you can use gcmsg "Your commit message".
- Some Common Aliases Provided by the Git Plugin
gaa: git add --all
gc!: git commit -v --amend
gcm: git commit -m
gd: git diff
gl: git pull
gp: git push
gst: git status
3.2. Zsh-autosuggestions
What?
The zsh-autosuggestions plugin is a powerful extension for Zsh (Z Shell) that suggests commands as you type, based on your command history and previously entered commands. This is an extremely useful tool for enhancing the command line experience, making working in the terminal faster and easier by reducing the number of typing required and helping to avoid typos.
Why?
- Efficiency: It speeds up your workflow by suggesting commands you can use, saving you time and keystrokes.
- Convenience: It helps to recall complex commands or those that are not used frequently without having to dig through your history.
- Learning Tools: For new commands or options you're starting to use, seeing them as suggestions can help reinforce their syntax and usage.
How?
- Clone the zsh-autosuggestions into the Oh My Zsh plugin folder
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- Activate Plugin: Open your ~/.zshrc file in a text editor.
nano ~/.zshrc
- Find the plugins= line and add zsh-autosuggestions to the plugins list. Make sure each plugin is separated by a space. For example:
plugins=(git zsh-autosuggestions)
Save the file and exit the editor.
- Apply changes: For the changes to take effect, restart your terminal or get your .zshrc file with:
source ~/.zshrc
Once reloaded, start typing commands in your terminal. You'll see suggestions with an opaque text color. To accept the suggestion, press the right arrow key or Ctrl+F.
3.3. Zsh-syntax-highlighting
What?
The zsh-syntax-highlighting plugin is an extension for Zsh (Z Shell) that adds syntax highlighting to the command line, making it easier to read commands and detect errors. It highlights different parts of commands you type in different colors depending on their syntax and function, similar to syntax highlighting in text editors and IDEs. This feature not only improves command readability, but also helps identify syntax errors, improve command line efficiency, and reduce the likelihood of errors.
Why?
- Improved readability: By color-coding commands, options, and arguments, it makes the command line interface friendlier and easier to understand.
- Error detection: Helps detect syntax or spelling errors in commands before they are executed, potentially saving time and preventing unintended operations.
- Learning Aid: For those new to the command line or learning new commands, syntax highlighting can assist in understanding the structure and syntax of command line operations.
How?
- Clone the zsh syntax highlighting archive into the Oh My Zsh custom plugin folder by running:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- Activate Plugin:
nano ~/.zshrc
Add zsh-syntax-highlighting to the list of plugins.
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
- Apply changes: To activate the plugin, restart your terminal or get your .zshrc file with:
source ~/.zshrc
Once reloaded, you will see syntax highlighting applied to the commands you enter in the terminal.
3.4. You-should-use
What?
The plugin you should use for Oh My Zsh is a useful tool designed to remind users of existing aliases for commands they enter in the terminal. When you enter a command with an alias, you should use will notify you of the alias you could have used instead. This feature is especially useful for learning and remembering to use the keyboard shortcuts you have set up, thereby improving your command line workflow and efficiency.
Why?
- Efficiency: By reminding you of aliases, it encourages the use of shorter commands, saving time and keystrokes.
- Learning: It's a great way to learn and remember aliases, especially if you've defined many or are adapting to new ones.
- Consistency: Helps maintain consistency in command usage, especially if you are working in a team environment where aliases are shared among members.
How?
- Clone the archive into the Oh My Zsh custom plugin folder by running:
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/you-should-use
Activate Plugin:
nano ~/.zshrc
Find the line plugins= and add the one you should use to the list of plugins. Make sure plugins are separated by spaces. For example:
plugins=(git zsh-autosuggestions zsh-syntax-highlighting you-should-use)
Save and close the file.
- Apply changes:
source ~/.zshrc
Once enabled, if you enter a command where an alias exists you should use will display an alias suggestion message.
Bonus: aliases
What?
In the context of Oh My Zsh and shell environments in general, aliases are shortcuts or abbreviations that you can define for longer commands or sequences of commands. They allow you to execute complex or frequently used commands using a shorter, simpler string. Aliases are a powerful feature of Zsh (and other shells like bash) that can significantly enhance your productivity and efficiency when working in the terminal.
Why?
- Efficiency and Speed: Aliases reduce the amount of typing required for long or complex commands, saving time and effort.
- Simplification: They simplify complex commands with multiple options or pipelines into something memorable.
- Customization: Allows you to tailor your command line interface to your workflow, making frequently used commands more accessible.
- Consistency: Helps maintain consistency in command usage, especially useful in shared environments or scripts.
How?
- Defining Aliases Direct Definition: You can define aliases directly in your terminal session, but these will only last for the duration of the session. For example:
alias ll='ls -lah'
- Persistent Aliases: For aliases to persist across sessions, you need to define them in your Zsh configuration file, typically ~/.zshrc for Zsh users. Open ~/.zshrc in a text editor:
nano ~/.zshrc
Then add your alias definitions to the file:
alias ll='ls -lah'
alias ca2='~/Core/core-api-v2'
Save and close the file. For the changes to take effect, either restart your terminal or source your .zshrc file:
source ~/.zshrc
- Using Aliases: Once defined, simply type the alias at the command prompt and press Enter to execute the associated command. For example, typing ll will execute ls -lah.
- Managing Aliases: To see a list of all currently defined aliases, type alias without arguments.
Summary
These plugins enhance my productivity and simplify my tasks. They enhance both the look and the performance of your Zsh shell.