You may also find interesting
source-highlight released under GNU.
You can add it as alias e.g. in your
.bash_aliases with something like the line below.
alias Cat='source-highlight --out-format=esc -o STDOUT -i'
Cat myfile.c # or myfile.xml ...
Or you can do a similar alias (without the
-iat the end to have the possibility to pipe in)
alias PCat='source-highlight --out-format=esc -o STDOUT '
tail myfile.sh | PCat # Note the absence of the `-i`
apt-cache show source-highlight:
Description-en: convert source code to syntax highlighted document.
This program, given a source file, produces a document with syntax
It supports syntax highlighting for over 100 file formats, including
major programming languages, markup formats, and configuration file
formats. For output, the following formats are supported: HTML,
XHTML, LaTeX, Texinfo, ANSI color escape sequences, and DocBook
Among the options that you can read from
man source-highlight the
-s, --src-lang=STRING source language (use --lang-list to get the complete list). If not specified, the source language will be guessed from the file extension.
list all the supported language and associated language definition file