zoxide
Jump to a directory by a fragment of its name, ranked by how often and how recently you go there.
What it does
zoxide tracks directories you visit and scores them by frequency and recency (“frecency”). z hextra jumps to the highest-scoring directory matching that fragment, from anywhere.
z lab # jump to the best match
zi lab # pick from matches interactively (needs fzf)
z - # previous directoryNotes
Add eval "$(zoxide init zsh)" to ~/.zshrc. zoxide init zsh --cmd cd replaces cd outright, which is the configuration most people end up at. The database lives in ~/.local/share/zoxide and can be imported from z, autojump or fasd.
Alternative to
| Alternative | Type | Trade-off |
|---|---|---|
| autojump | Open source | The original of this idea, Python-based |
| z (rupa) | Open source | A single shell script, no binary to install |
| fasd | Open source | Tracks files as well as directories, now unmaintained |
CDPATH | Built in | Built into the shell, and enough for a fixed set of project roots |
Install
brew install zoxide