Syntax highlighting in less. Bashrc snippet

Based to this post, 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

Set SRCHILITELESSPIPE for custom location

To install:

sudo yum install source-highlight

SRCHILITELESSPIPE=${SRCHILITELESSPIPE:-$(which 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]