Hacker News new | ask | show | jobs
by coffeeindex 541 days ago
Is the “foo.fish” name required? Could I have “bar.fish” with “function foo…” inside and still autoload function foo?
1 comments

Not autoload, no. You can have as many functions as you want in a single .fish file, but it'll only be lazily autoloaded if it has the same name as the command you are trying to execute. It's how we avoid doing the I/O of scanning all fish directories and parsing their contents at startup.
...and you can still explicitly source the files if you want to load the functions elsewhere.