Introduction
If you’re like me, you’re constantly zipping around directories in your terminal, trying to keep up with your coding projects, side hustles, and random tech adventures. But let’s be real for a second: the old cd command? It’s feels like trying to navigate a maze blindfolded.
Zoxide
https://github.com/ajeetdsouza/zoxide
So, I stumbled upon this game-changing tool that’s about to revolutionize the way you navigate your terminal: Zoxide. It works like magic in your terminal. It keeps track of the directories you frequently visit and ranks them based on your usage patterns. So, when you need to navigate to a directory, instead of wracking your brain trying to recall its exact path, you simply type z <directory_name> and voila! Zoxide intelligently takes you there in an instant.
Installation
https://github.com/ajeetdsouza/zoxide#installation
Install binary
Installing Zoxide is a breeze. You can grab it from your favorite package manager or build it from source – whatever floats your boat.
I use Arch BTW, so I’ll install it using pacman:
Setup zoxide
Once installed, just add a tiny snippet to the end of your shell configuration file (like .bashrc or .zshrc), and you’re good to go!
For bash:
For fish:
For zsh:
Usage
To unlock its full potential, it’s a good idea to train it. Training Zoxide involves simply using your terminal as you normally would for a bit, letting Zoxide observe your directory navigation patterns. Try navigating to your projects with Zoxide.
After training, using Zoxide is as easy as typing z <directory_name> to quickly navigate to frequently accessed directories without the full path!
Rebinding
Now, Zoxide is incredible, no doubt about it. But what if you’re a creature of habit, like me, who’s been typing cd for eons?
You can easily rebind the z command to cd, so you don’t have to mess with your muscle memory:
For bash:
For fish:
For zsh:
Conclusion
In short, Zoxide is your terminal’s new best friend, guiding you effortlessly through directories with just a few keystrokes. Say goodbye to aimless navigation and hello to smooth sailing with Zoxide!
PS: This is my first blog, so your feedback means the world to me!