D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Syntax highlighting cat (vim?)

 

Neil Williams wrote:
> On Mon, 2008-11-10 at 12:50 +0000, Simon Williams wrote:
>> Does anyone know if there is such a thing as a cat command which does 
>> syntax highlighting?

> vim will expect to write the file out, so you need to use :q! to exit.

Or...

cat chess/chess/src/main.c |  source-highlight --src-lang=c --out-format=esc

Although to be honest "esc" isn't that useful an output format,
source-highlight does a load of other languages and output formats.

Simon, why were you after this? Source highlighting is useful for
editing and documentation, but it seems pretty pointless as just part of
 cat'ing a file.

I'm thinking "view" is maybe what you are looking for, starts vim in
read-only mode, but maybe there is something else you are trying to do.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html