有没有办法告诉 Fish shell 更正带空格的命令中的常见拼写错误?

Is there a way to tell Fish shell to correct common typos in commands with spaces?

我是 Fish 的新手,目前为止我很喜欢它,但我对缩写不能有空格感到恼火。例如,当我键入 git statsu 时,我比 git status 的实际命令执行得更频繁,我希望它用正确的命令替换文本。我尝试将以下内容添加到我的 config.fish 文件中:

abbr "git statsu" "git status"

…这给了我:

abbr --add: Abbreviation 'git statsu' cannot have spaces in the word

第二次尝试(不支持带空格的别名):

alias "git statsu"="git status"
- (line 1): function: Unexpected positional argument 'statsu'
function git statsu --wraps 'git status' --description 'alias git statsu=git status';  git status $argv; end
^
from sourcing file -
    called on line 61 of file /usr/share/fish/functions/alias.fish
in function 'alias' with arguments 'git\ statsu=git\ status'
    called on line 19 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
    called on line 1 of file -
in function 'config'

同样,我尝试:

alias "git\ statsu"="git\ status"

静默失败:

> git statsu
git: 'statsu' is not a git command. See 'git --help'.

The most similar command is
    status

最后(第一个参数未展开后的缩写):

abbr statsu status
> git statsu
git: 'statsu' is not a git command. See 'git --help'.

The most similar command is
    status

请提供替代解决方案;我厌倦了不断输入错误的命令并不得不手动更正它。

为什么不使用 git 别名呢?这是我的几个:

$ cat ~/.gitconfig
...
[alias]
    co = checkout
    stat = status

这里有一个你可以做的鱼的事情,它很容易用其他常见的拼写错误来扩展:

function git
    switch $argv[1]
        case statsu
            set argv[1] status
    end
    command git $argv
end