An alias to give the world some color

Just wanted to share my new favourite alias. Really nice, especially if you read a lot of source code using less and prefer colors.

alias cless='LESSOPEN="| highlight --ansi --force %s" less -NR'

Tip: If you’d like more colors, replace –ansi with –xterm256.

Posted Wednesday, February 14th, 2007 under linux.

Tags:

2 comments

  1. Bra trick. Tyværr fungerar inte highlight så bra i den version jag har.. (den kraschar bara med –ansi, ej –latex etc)

    $ cat kod.c | highlight –ansi
    Segmenteringsfel

  2. Pygments is spiffy albeit not quite as speedy. Here’s my cless:
    alias cless='LESSOPEN="| pygmentize -O bg=dark %s" less -NR'