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 the following line to your configuration file (usually `~/.bashrc`):
38 eval "$(zoxide init bash)"
43 Add the following line to your configuration file (usually `~/.elvish/rc.elv`):
46 eval $(zoxide init elvish | slurp)
51 Add the following line to your configuration file (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 Then, in your Nushell configuration file:
67 - Prepend `__zoxide_hook;` to the `prompt` variable.
68 - Add the following lines to the `startup` variable:
69 - `zoxide init nushell --hook prompt | save ~/.zoxide.nu`
70 - `source ~/.zoxide.nu`
74 Add the following line to your profile:
77 Invoke-Expression (& {
78 $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
79 (zoxide init --hook $hook powershell) -join "`n"
85 Add the following line to your configuration file (usually `~/.xonshrc`):
88 execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')
93 Add the following line to your configuration file (usually `~/.zshrc`):
96 eval "$(zoxide init zsh)"
101 Add the following line to your configuration file:
104 eval "$(zoxide init posix --hook prompt)"