Simplify fish init script

This commit is contained in:
Kid 2022-03-26 04:25:27 +08:00 committed by GitHub
parent 17365710af
commit ab37a8f040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 10 deletions

View File

@ -102,20 +102,15 @@ end
{%- match cmd %} {%- match cmd %}
{%- when Some with (cmd) %} {%- when Some with (cmd) %}
# Remove definitions. function {{cmd}}
function __zoxide_unset __zoxide_z $argv
set --erase $argv >/dev/null 2>&1
abbr --erase $argv >/dev/null 2>&1
builtin functions --erase $argv >/dev/null 2>&1
end end
__zoxide_unset {{cmd}}
alias {{cmd}}=__zoxide_z
complete -c {{cmd}} -e complete -c {{cmd}} -e
complete -c {{cmd}} -f -a '(__zoxide_z_complete)' complete -c {{cmd}} -f -a '(__zoxide_z_complete)'
__zoxide_unset {{cmd}}i function {{cmd}}i
alias {{cmd}}i=__zoxide_zi __zoxide_zi $argv
end
{%- when None %} {%- when None %}