nushell: use sigil operator (#1070)

This commit is contained in:
Steven Xu 2025-05-31 09:23:54 +10:00 committed by GitHub
parent d6c0203c09
commit db14bdc2ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ export-env {
if not $__zoxide_hooked {
$env.config.hooks.pre_prompt = ($env.config.hooks.pre_prompt | append {
__zoxide_hook: true,
code: {|| zoxide add -- $env.PWD}
code: {|| ^zoxide add -- $env.PWD}
})
}
{%- else if hook == InitHook::Pwd %}
@ -43,7 +43,7 @@ export-env {
if not $__zoxide_hooked {
$env.config.hooks.env_change.PWD = ($env.config.hooks.env_change.PWD | append {
__zoxide_hook: true,
code: {|_, dir| zoxide add -- $dir}
code: {|_, dir| ^zoxide add -- $dir}
})
}
{%- endif %}
@ -62,7 +62,7 @@ def --env --wrapped __zoxide_z [...rest: string] {
[ '-' ] => {'-'},
[ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg}
_ => {
zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
^zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
}
}
cd $path
@ -73,7 +73,7 @@ def --env --wrapped __zoxide_z [...rest: string] {
# Jump to a directory using interactive search.
def --env --wrapped __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
cd $'(^zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
{%- if echo %}
echo $env.PWD
{%- endif %}