Syntax highlighting in less. Bashrc snippet

Based to this post, http://linux-tips.org/article/78/syntax-highlighting-in-less my fast tip to allow syntax highlight in less:

[sourcecode language="bash"] cat <> ~/.bash_profile

Syntax Highlight for less

Check if source highlite is intalled http://www.gnu.org/software/src-highlite/

Set SRCHILITELESSPIPE for custom location

To install:

sudo yum install source-highlight

SRCHILITELESSPIPE=${SRCHILITELESSPIPE:-$(which src-hilite-lesspipe.sh 2> /dev/null)} if [ -x "$SRCHILITELESSPIPE" ]; then export LESSOPEN="| $SRCHILITELESSPIPE %s" export LESS="${LESS/ -R/} -R" # Set LESS option in raw mode (avoid repeating it) fi EOF [/sourcecode]