PeterDaveHello / ColorEchoForShell

Make 🐚(shell) 's 💬 (`echo`) to be 🎨 easily ✨ Support ✅ sh ➕ bash ➕ zsh ➕ ksh ➕ 🐟 One simple command for vibrant text output! 💫
GNU General Public License v2.0
109 stars 18 forks source link

Fish shell interactive use #14

Open edouard-lopez opened 7 months ago

edouard-lopez commented 7 months ago

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 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

PeterDaveHello commented 2 months ago

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.