Top 10 Oh My Zsh Plugins For Productive Developers
Video version - or watch it on YouTube
Or if you prefer to read the article, read on!
First, How to Install These Plugins
- In your terminal open ~/.zshrc with vi or nano (or notepad/code editor if your a bum)
- Add the desired plugins to your plugin list with spaces between like so:
plugins=(git kubectl history emoji encode64)
1. Zsh Autosuggestions
As you type, you’ll see a suggested completion come up in a faded gray color.
If you hit the right arrow key, it will fill in the suggestion. If you hit tab, it will list more suggestions below it. Continue to hit tab to cycle thorough.
I could honestly NOT survive anymore without the Zsh Autosuggestions plugin.
Note: This is the only plugin that requires you to actually install it first.
You know when you type in a command that fails because you didnt run sudo? Either you have to retype it with sudo at the front or hit the up arrow and then arrow back to the beginning of the sentence?
Well, the sudo plugin takes what you just typed and adds a sudo at the beginning for you.
The shortcut is to hit the escape key twice.
3. Web Search
Imagine…you’re in the terminal and you need to google something.
No need to switch over to your browser, just run the search from your terminal with the Web Search plugin.
Sometimes you are deep in a folder and remember that you have to go back to update another file in the parent.
You don’t want to have to go back out and re-input that long path over again.
Well, you don’t. You can use the Copydir plugin to copy the path to your current directory to the clipboard.
Copy it. Go back out and do what you have to do. Then cd paste that bad boy back in.
Copy the contents of a file to your clipboard.
It’s a capability you don’t know you need until you need it. You can get ahead of the game now with the copyfile plugin.
Copybuffer is a plugin that allows you to copy the text currently typed in the command line.
I know, I know… you can’t think of a specific scenario where you need this at the moment. But you will.
Ctrl+O copies the text to the clipboard.
This one is powerful.
Alt+Left takes you into the previous directory you were in. Alt+Right reverts that (moves you forward). And alt+up puts you in the parent directory.
See below how efficient the dirhistory plugin is.
8. Zsh Reload
This plugin is now deprecated. You can run the command “exec zsh” instead.
You know when you make changes to .bashrc or .bash_history or .zshrc, and you have to reopen the terminal or “source” it to refresh.
Well now just type src and hit enter to refresh the zsh session.
This plugin is a real time saver.
The History command on any Unix system will show us a long list of commands that we have run in the past.
And if we want to recall a command from last week that we used, we grep it.
This plugin makes it as simple as a few keystrokes to search for past commands.
h - prints your history
hs [searchterm] - searches your history with grep
hsi [serachterm] - same as above but case insensitive.
10. Json Tools
Don’t you hate to make an api call or curl request and return a bunch of jumbled json?
This plugin has a number of neat capabilities, but I mainly use it to pretty print json.
Just pipe your call with | pp_json
For you Mac users, don’t miss these. I honestly could do a whole post on this plugin.
The osx plugin is now deprecated and has been renamed to macos. It’s all the same functionality and can be found here. Be sure to update the name in your .zshrc plugins.
Here are a few of my favorites:
- ofd - Opens the current directory in a Finder window
- pfd - Prints the path of the frontmost Finder window
- cdf - cd to the current Finder selection.
- man-preview - Opens a specified man page in Preview app
- tab - Opens current directory in new tab
- showfiles/hidefiles - shows or hides hidden files
What are your favorite terminal plugins for productivity?
** This article may contain affiliate links. Please read the affiliate disclaimer for more details.