zoxide: A smarter cd command.

Files

These are the files / directories that are created and/or modified with this install:

~/.config/envman/PATH.env
~/.local/bin/zoxide

Cheat Sheet

zoxide is a smarter cd command for your terminal. It keeps track of the directories you visit, so that you can switch to them using just a few keystrokes.

tutorial

Usage

z foo       # cd to highest ranked directory matching foo
z foo bar   # cd to highest ranked directory matching foo and bar

z foo/      # can also cd into actual directories
z ..        # cd into parent directory
z -         # cd into previous directory

zi foo      # cd with interactive selection (requires fzf)

Add zoxide to your shell

To use zoxide, it needs to be first initialized on your shell:

bash

Add this to your configuration (usually ~/.bashrc):

eval "$(zoxide init bash)"

elvish

Add this to your configuration (usually ~/.elvish/rc.elv):

eval (zoxide init elvish | slurp)

fish

Add this to your configuration (usually ~/.config/fish/config.fish):

zoxide init fish | source

nushell 0.32.0+

Initialize zoxide's Nushell script:

zoxide init nushell --hook prompt | save ~/.zoxide.nu

Add this to your configuration (usually ~/.config/nu/config.toml):

prompt = "__zoxide_hook;__zoxide_prompt"
startup = ["zoxide init nushell --hook prompt | save ~/.zoxide.nu", "source ~/.zoxide.nu"]

You can replace __zoxide_prompt with a custom prompt.

powershell

Add this to your configuration (the location is stored in $profile):

Invoke-Expression (& {
    $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
    (zoxide init --hook $hook powershell) -join "`n"
})

xonsh

Add this to your configuration (usually ~/.xonshrc):

execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')

zsh

Add this to your configuration (usually ~/.zshrc):

eval "$(zoxide init zsh)"

Any POSIX shell

Add this to your configuration:

eval "$(zoxide init posix --hook prompt)"

Contribute

Report an Issue Submit Installer Star on GitHub