How to define an alias in fish shell?

前端 未结 10 634
星月不相逢
星月不相逢 2020-12-07 06:56

I would like to define some aliases in fish. Apparently it should be possible to define them in

~/.config/fish/functions

but they don\'t g

10条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 07:43

    For posterity, fish aliases are just functions:

    $ alias foo="echo bar"
    $ type foo
    foo is a function with definition
    function foo
        echo bar $argv; 
    end
    

    To remove it

    $ unalias foo
    /usr/bin/unalias: line 2: unalias: foo: not found
    $ functions -e foo
    $ type foo
    type: Could not find “foo”
    

提交回复
热议问题