From ab37a8f040e4d39700b04ce3537c385057303a7a Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Sat, 26 Mar 2022 04:25:27 +0800 Subject: [PATCH] Simplify fish init script --- templates/fish.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/templates/fish.txt b/templates/fish.txt index 19cb234..93cdec8 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -102,20 +102,15 @@ end {%- match cmd %} {%- when Some with (cmd) %} -# Remove definitions. -function __zoxide_unset - set --erase $argv >/dev/null 2>&1 - abbr --erase $argv >/dev/null 2>&1 - builtin functions --erase $argv >/dev/null 2>&1 +function {{cmd}} + __zoxide_z $argv end - -__zoxide_unset {{cmd}} -alias {{cmd}}=__zoxide_z complete -c {{cmd}} -e complete -c {{cmd}} -f -a '(__zoxide_z_complete)' -__zoxide_unset {{cmd}}i -alias {{cmd}}i=__zoxide_zi +function {{cmd}}i + __zoxide_zi $argv +end {%- when None %}