z foo # cd into highest ranked directory matching foo
z foo bar # cd into highest ranked directory matching foo and bar
z foo / # cd into a subdirectory starting with foo
z ~/foo # z also works like a regular cd command
z foo/ # cd into relative path
z .. # cd one level up
z - # cd into previous directory
zi foo # cd with interactive selection (using fzf)
z foo<SPACE><TAB> # show interactive completions (bash 4.4+/fish/zsh only)
Add this to the end of your config file (usually ~/.zshrc):
eval "$(zoxide init zsh)"
For completions to work, the above line must be added aftercompinit is
called. You may have to rebuild your completions cache by running
rm ~/.zcompdump*; compinit.
Any POSIX shell
Add this to the end of your config file:
eval "$(zoxide init posix --hook prompt)"
Note:Warp provides its own completions, so Space+Tab completions are not
supported there.
Install fzf(optional)
fzf is a command-line fuzzy finder, used by zoxide for completions /
interactive selection. It can be installed from here.
Note:
The minimum supported fzf version is v0.51.0.
Import your data(optional)
If you currently use any of these plugins, you may want to import your data
into zoxide:
[^1]:
Debian / Ubuntu derivatives update their packages very slowly. If you’re
using one of these distributions, consider using the install script instead.
[^2]:
If you’re not sure how to set an environment variable on your shell, check
out the wiki.
Special thanks to:
zoxide
zoxide is a smarter cd command, inspired by z and autojump.
It remembers which directories you use most frequently, so you can “jump” to them in just a few keystrokes.
zoxide works on all major shells.
Getting started • Installation • Configuration • Integrations
Getting started
Read more about the matching algorithm here.
Installation
zoxide can be installed in 4 easy steps:
Install binary
zoxide runs on most major platforms. If your platform isn’t listed below, please open an issue.
Linux / WSL
macOS
Windows
BSD
Android
Setup zoxide on your shell
To start using zoxide, add it to your shell.
Bash
Elvish
Fish
Nushell
PowerShell
Tcsh
Xonsh
Zsh
Any POSIX shell
Install fzf (optional)
fzf is a command-line fuzzy finder, used by zoxide for completions / interactive selection. It can be installed from here.
Import your data (optional)
If you currently use any of these plugins, you may want to import your data into zoxide:
autojump
fasd, z, z.lua, zsh-z
ZLocation
Configuration
Flags
When calling
zoxide init, the following flags are available:--cmdzandzicommands.--cmd jwould change the commands to (j,ji).--cmd cdwould replace thecdcommand.--hook <HOOK>Changes how often zoxide increments a directory’s score:
nonepromptpwd(default)--no-cmdzandzicommands.__zoxide_zand__zoxide_zi, should you choose to redefine them.Environment variables
Environment variables[^2] can be used for configuration. They must be set before
zoxide initis called._ZO_DATA_DIRSpecifies the directory in which the database is stored.
The default value varies across OSes:
$XDG_DATA_HOMEor$HOME/.local/share/home/alice/.local/share$HOME/Library/Application Support/Users/Alice/Library/Application Support%LOCALAPPDATA%C:\Users\Alice\AppData\Local_ZO_ECHOzwill print the matched directory before navigating to it._ZO_EXCLUDE_DIRSExcludes the specified directories from the database.
This is provided as a list of globs, separated by OS-specific characters:
:$HOME:$HOME/private/*;$HOME;$HOME/private/*By default, this is set to
"$HOME"._ZO_FZF_OPTSman fzffor the list of options._ZO_MAXAGE_ZO_RESOLVE_SYMLINKSzwill resolve symlinks before adding directories to the database.Third-party integrations
tmuxsession managertmuxsession managertmuxsession managerzellijsession manager[^1]: Debian / Ubuntu derivatives update their packages very slowly. If you’re using one of these distributions, consider using the install script instead.
[^2]: If you’re not sure how to set an environment variable on your shell, check out the wiki.