nushell: use sigil operator (#1070)
This commit is contained in:
parent
d6c0203c09
commit
db14bdc2ff
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue