chroma
TLDR
Highlight source file
$ chroma [file.go]
Specify language$ chroma -l python [file.py]
HTML output$ chroma --html [file.js] > [output.html]
List available lexers$ chroma --list
Use specific style$ chroma -s monokai [file.rb]
HTML with inline styles$ chroma --html --html-inline-styles [file.c]
SYNOPSIS
chroma [options] [file...]
DESCRIPTION
chroma is a general purpose syntax highlighter supporting ~250 languages. Converts source code to syntax highlighted HTML, ANSI-colored terminal output, and more. Based on Pygments. Written in Go.
PARAMETERS
-l, --lexer name
Lexer to use (default: autodetect)-s, --style name
Highlighting style-f, --formatter name
Output formatter: terminal, terminal256, terminal16m, html--html
Enable HTML mode--html-only
Output HTML fragment only--html-inline-styles
Inline CSS styles (no classes)--list
List lexers, styles, formatters--fail
Exit with status 1 if lexer not found
USAGE WITH LESS
$ export LESSOPEN='| chroma --fail "$1" || cat "$1"; "%s"'
CAVEATS
Autodetects language from filename and content. Use --fail for fallback pipelines.
SEE ALSO
highlight(1), pygmentize(1), bat(1)


