Skip to content

Feature Request: Print natively syntax-highlighted code to stdout. #1827

@geoff-nixon

Description

@geoff-nixon

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions