Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support z -- <dir> for zsh and fish #858

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading