3 homepage: https://github.com/ajeetdsouza/zoxide
5 zoxide: A smarter cd command.
10 `zoxide` is a smarter `cd` command for your terminal. It keeps track of the
11 directories you visit, so that you can switch to them using just a few
14 ![tutorial](https://github.com/ajeetdsouza/zoxide/raw/main/contrib/tutorial.webp)
19 z foo # cd to highest ranked directory matching foo
20 z foo bar # cd to highest ranked directory matching foo and bar
22 z foo/ # can also cd into actual directories
23 z .. # cd into parent directory
24 z - # cd into previous directory
26 zi foo # cd with interactive selection (requires fzf)
29 ## Add zoxide to your shell
31 To use zoxide, it needs to be first initialized on your shell:
35 Add this to your configuration (usually `~/.bashrc`):
38 eval "$(zoxide init bash)"
43 Add this to your configuration (usually `~/.elvish/rc.elv`):
46 eval (zoxide init elvish | slurp)
51 Add this to your configuration (usually `~/.config/fish/config.fish`):
54 zoxide init fish | source
59 Initialize zoxide's Nushell script:
62 zoxide init nushell --hook prompt | save ~/.zoxide.nu
65 Add this to your configuration (usually `~/.config/nu/config.toml`):
68 prompt = "__zoxide_hook;__zoxide_prompt"
69 startup = ["zoxide init nushell --hook prompt | save ~/.zoxide.nu", "source ~/.zoxide.nu"]
72 You can replace `__zoxide_prompt` with a custom prompt.
76 Add this to your configuration (the location is stored in `$profile`):
79 Invoke-Expression (& {
80 $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
81 (zoxide init --hook $hook powershell) -join "`n"
87 Add this to your configuration (usually `~/.xonshrc`):
90 execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')
95 Add this to your configuration (usually `~/.zshrc`):
98 eval "$(zoxide init zsh)"
103 Add this to your configuration:
106 eval "$(zoxide init posix --hook prompt)"