How to define an alias in fish shell?

前端 未结 10 603
星月不相逢
星月不相逢 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条回答
  •  -上瘾入骨i
    2020-12-07 07:39

    I found the prior answers and comments to be needlessly incomplete and/or confusing. The minimum that I needed to do was:

    1. Create ~/.config/fish/config.fish. This file can optionally be a softlink.
    2. Add to it the line alias myalias echo foo bar.
    3. Restart fish. To confirm the definition, try type myalias. Try the alias.

提交回复
热议问题