Last Updated: February 25, 2016
·
3.681K
· sheerun

Enable syntax highlight in less!

Install source-highlight package:

brew install source-highlight

And add following to your shell startup file:

export LESSOPEN="| src-hilite-lesspipe.sh %s"
export LESS=" -R "

2 Responses
Add your response

Thanks, very nice tip! but Less should be called with "-R" option to enable the color.

over 1 year ago ·

@0xnan Thank you for noticing this :) I've updated the protip.

over 1 year ago ·