14 lines
366 B
Fish
14 lines
366 B
Fish
function __zoxide_z
|
|
set --local argc (count $argv)
|
|
if test $argc -eq 0
|
|
__zoxide_cd $HOME
|
|
else if test "$argv" = -
|
|
__zoxide_cd -
|
|
else if test $argc -eq 1 -a -d $argv[1]
|
|
__zoxide_cd $argv[1]
|
|
else
|
|
set --local result (command zoxide query --exclude (__zoxide_pwd) -- $argv)
|
|
and __zoxide_cd $result
|
|
end
|
|
end
|