Advantages over plain zoxide init fish | source
:
- Faster shell startup by AOT initialization
- Managed as a plugin, can be installed or disabled via plugin managers
zoxide.fish is configured via fish variables instead of zoxide flags.
- Use a different prefix:
set --universal zoxide_cmd j
(same aszoxide init --cmd j
) - Disable predefined aliases:
set --universal zoxide_cmd
(same aszoxide init --no-aliases
)
zoxide | zoxide.fish |
---|---|
zoxide init --hook none |
set --universal zoxide_hook |
zoxide init --hook prompt |
set --universal zoxide_hook --on-event fish_prompt |
zoxide init --hook pwd |
set --universal zoxide_hook --on-variable PWD (default) |
Thanks to the flexibility of zoxide.fish, you can define custom hooks that is not available via zoxide init
(e.g. set --universal zoxide_hook --on-event fish_postexec
).
zoxide.fish also respects a few environment variables that are used by zoxide:
$_ZO_ECHO
: When set to1
(set --universal _ZO_ECHO 1
), zoxide.fish prints the matched directory before navigating to it.$_ZO_RESOLVE_SYMLINKS
: When set to1
(set --universal _ZO_RESOLVE_SYMLINKS 1
), zoxide.fish will resolve symlinks before adding directories to the database.