Zoxide - enhanced directory navigation
Background
This is a super handy tool to quickly navigate to past directories, I recently found Zoxide through this video in my youtube suggestions.
Setup
The setup from the github readme is relatively easy. I definitely recommend following suggestion in both the video and the guide to also install fzf which gives a interface for the index. I only encountered issues when the I didn't have local administrative privileges or if my terminal couldn't access the internet.
A cool feature mentioned in the video was the --cmd cd which translates cd to a z command, and allows me to maintain my cd muscle memory. You add it after your zoxide init for your shell profile for example, zoxide init --cmd cd $your_shell
Fish shell configuration
I added the following to my fish config ~/.config/fish/config.fish
zoxide init --cmd cd fish | source
领英推荐
powershell
for powershell, you can add the following command to your Documents\WindowsPowerShell\profile.ps1
Invoke-Expression (& { (zoxide init --cmd cd powershell | Out-String) })
for other configurations see the readme and check where your shell configuration file is located
Cool Features/How it works
As you run z commands to navigate to directories, Zoxide builds a index of your most common navigated to directories. In the past, I would would need to run cd /home/progressedd/windows/OneDrive - EY/Documents/foam_notes to get into that folder.
After navigating to the directory once by pasting the full path or entering the directory with Zoxide I can use the command z home foam_notes to automatically enter my directory
With the --cmd cd, cd is translated to a z and zi command. Since I previously navigated to the foam_notes directory, I can run cd home foam_notes to navigate to my foam_notes directory. Using cdi, I can get a quick list of the index and recall the folder names to use for my zoxide command
If you would like to get detailed instructions for how to set up Zoxide with limited administrative privileges, I posted about it in the setup section of this Level1techs post