Fish shell interactive use

#14 · open · 1 comments

View on GitHub ↗

edouard-lopez

Not really an issue, just a snippet to use interactively as the `dist` file contains multiple function declarations, we can't use native Fish [autoloading mechanism](https://fishshell.com/docs/current/language.html#autoloading-functions) and need to extract the functions ### Fetch the dist script for fish ``` curl --location --output $__fish_config_dir/functions/ColorEcho.fish https://raw.githubusercontent.com/PeterDaveHello/ColorEchoForShell/master/dist/ColorEcho.fish ``` ### Extract the functions, one per file to leverage autoloading ``` functions \ | grep echo. \ | while read line; \ funcsave $line --directory $__fish_config_dir/functions/echo-colored/; \ end ``` ### Tell Fish where we extracted the functions, so he can look there too ``` echo 'set --append fish_function_path $HOME/.config/fish/functions/echo-colored' >> $__fish_config_dir/config.fish ``` ### Preview Open a new shell and try it https://github.com/PeterDaveHello/ColorEchoForShell/assets/1212392/7ef46a61-566a-473d-9076-b9a81795f911

Comments

PeterDaveHello

Hi @edouard-lopez, Thank you for the information. Do you also have a suggestion about how to deal with it? I'm not familiar with fish shell, but I would like to see what we can do about it.