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 get auto loaded when I restart the shell. Any ideas?
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
Just use
Interested people might like to find out more about fish aliases in the official manual. |
|||||||||||||||||||||
|
|
This is how I define a new function
|
|||||||||||||
|
|
For posterity, fish aliases are just functions:
To remove it
|
|||||||||
|
|
|||
|
|
|
Save your files as |
|||
|
|
|
To properly load functions from ~/.config/fish/functions You may set only ONE function inside file and name file the same as function name + add .fish extension. This way changing file contents reload functions in opened terminals (note some delay may occur ~1-5s) That way if you edit either by commandline
then
you have user defined functions in console and custom made in the same order. |
||||
|
|
|
make a function in ~/.config/fish/functions called mkalias.fish and put this in
and this will create aliases automatically. |
|||
|
|
|
fish starts by executing commands in ~/.config/fish/config.fish. You can create it if it does not exist. step1. make configuration file (like .bashrc)
step2. just write your alias like this;
|
|||
|
|
|
Open |
|||
|
|