From ba83bf67b20998e6e9e2d81dd1190ef39582a3bf Mon Sep 17 00:00:00 2001 From: Simsum <35268640+Kosette@users.noreply.github.com> Date: Thu, 4 May 2023 17:49:20 +0800 Subject: [PATCH] fix potential compatibilty issue for some fish shell versions and add autocompletion for cmd options 1. `alias` command not available in some fishshell versions like 3.3.1. use fish-native `function` instead; 2. add autocompletion for cmd options benefitting from magic power of fish. just type `z -` and press tab. enjoy yourself. --- z.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/z.lua b/z.lua index 9a1d733..307644b 100755 --- a/z.lua +++ b/z.lua @@ -2423,7 +2423,9 @@ function _zlua end if test -z "$_ZL_CMD"; set -x _ZL_CMD z; end -alias "$_ZL_CMD"=_zlua +function $_ZL_CMD -w _zlua -d "alias $_ZL_CMD=_zlua" + _zlua $argv +end ]] script_init_fish = [[