Reputation: 67
I have a config.fish
in ~/.config/fish
. While editing my fish_prompt
I accidentally deleted my aliases once. I did have backup, but I want to store all aliases separately from now on. Also, how can I auto-load all of my aliases when I source
the newly-edited config.fish
?
I have alias update="source ~/.config/fish/config.fish"
. So if I make change to the location of my config.fish
and edit the alias as necessary, next time I update
the updated alias should reflect in the updated config. How can I do this?
Upvotes: 2
Views: 1950
Reputation: 15914
There are a few things fish offers here:
So you can either put your functions/aliases in a function file each, or put them in files in conf.d in whatever grouping you want.
Also you can put your fish_prompt in its own file - ~/.config/fish/functions/fish_prompt.fish
(also "alias" is simply a cheesy helper function to make functions - the core shell has no concept of aliases)
Upvotes: 4