This commit is contained in:
2026-04-20 09:40:17 +02:00
parent 876194e91b
commit cafb3f1ecb
18 changed files with 321 additions and 92 deletions
+11 -5
View File
@@ -11,7 +11,11 @@ end
# A copy of fish's internal cd function. This makes it possible to use
# `alias cd=z` without causing an infinite loop.
if ! builtin functions --query __zoxide_cd_internal
string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source
if status list-files functions/cd.fish &>/dev/null
status get-file functions/cd.fish | string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' | source
else
string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source
end
end
# cd + custom logic based on the value of _ZO_ECHO.
@@ -86,11 +90,13 @@ end
# Commands for zoxide. Disable these using --no-cmd.
#
abbr --erase z &>/dev/null
alias z=__zoxide_z
abbr --erase cd &>/dev/null
complete --erase --command cd
alias cd=__zoxide_z
abbr --erase zi &>/dev/null
alias zi=__zoxide_zi
abbr --erase cdi &>/dev/null
complete --erase --command cdi
alias cdi=__zoxide_zi
# =============================================================================
#