A fish alias is actually implemented as a function. To save a function, you need funcsave. So this is the sequence
alias foo=bar
funcsave foo
That creates ~/.config/fish/functions/foo.fish
which will then be available in any fish session.
I prefer this method so that I can easily edit my aliases in a single file.
- Open
~/.config/fish/config.fish
in your favorite editor. If it's not already there, it'll make it for you. (Don't su it though.) - Add all the aliases you want. It'll save them and always load then because this is apparently Fish's version of bashrc.
- Save it, baby!
source ~/.config/fish/config.fish
Enjoy.