Skip to content

Commit

Permalink
Support z -- dir for zsh and fish (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
Undefined01 authored Jul 20, 2024
1 parent 8da8f50 commit d655e02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/fish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ function __zoxide_z
__zoxide_cd -
else if test $argc -eq 1 -a -d $argv[1]
__zoxide_cd $argv[1]
else if test $argc -eq 2 -a $argv[1] = --
__zoxide_cd -- $argv[2]
else if set -l result (string replace --regex -- $__zoxide_z_prefix_regex '' $argv[-1]); and test -n $result
__zoxide_cd $result
else
Expand Down
2 changes: 2 additions & 0 deletions templates/zsh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function __zoxide_z() {
__zoxide_cd ~
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
__zoxide_cd "$1"
elif [[ "$#" -eq 2 ]] && [[ "$1" = "--" ]]; then
__zoxide_cd "$2"
else
\builtin local result
# shellcheck disable=SC2312
Expand Down

0 comments on commit d655e02

Please sign in to comment.