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
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
function name; function_content; end
then
funcsave name
you have user defined functions in console and custom made in the same order.
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”
This is how I define a new function foo
, run it, and save it persistently.
sthorne@pearl~> function foo
echo 'foo was here'
end
sthorne@pearl~> foo
foo was here
sthorne@pearl~> funcsave foo
Save your files as ~/.config/fish/functions/{some_function_name}.fish
and they should get autoloaded when you start fish.