Emacs in -nw mode colors source code files, in this screenshot you see how emacs colors the .rb file I opened. Over the weeks/months I've gotten used to the coloring.
Despite how hard I try, there always comes a time when I'm
not in emacs, and I'm doing a cat
in the Terminal.app bash shell.
So much like you can pipe a compact block of json to get nicely
indented json, is it possible to pipe a .rb file to some scripts that runs Emacs and extracts the syntax coloring that Emacs uses?
highlight
from homebrew - see discussion on this page: unix.stackexchange.com/questions/267361/… - this package support colour customisation.e2ansi-cat
. It integrates with pagers likemore
andless
so anything you view with them becomes highlighted automatically.