I feel like there must already be a way to do this, but I just can't figure it out.
What I'd like to do is have a function, lets call it, um, catfish, which will print an arbitrary snippet of syntax-highlighted fish code (from file, or from stdin) to stdout, escape-sequences and all, so that if I redirect it to file and later cat file, it will be syntax-highlighted. (If you have pygments installed, this is basically the exact same functionality as pygmentize -g [-f 256], but for fish syntax, of course.)
I know there's functionality close to this already — commandline (cat script.fish), funced — but for my life I can't figure out how to trick it into redirecting to a fd or file.
Is this possible?
I feel like there must already be a way to do this, but I just can't figure it out.
What I'd like to do is have a function, lets call it, um,
catfish, which will print an arbitrary snippet of syntax-highlighted fish code (from file, or from stdin) to stdout, escape-sequences and all, so that if I redirect it tofileand latercat file, it will be syntax-highlighted. (If you have pygments installed, this is basically the exact same functionality aspygmentize -g [-f 256], but for fish syntax, of course.)I know there's functionality close to this already —
commandline (cat script.fish),funced— but for my life I can't figure out how to trick it into redirecting to a fd or file.Is this possible?