All you need is: pygmentize ( python-pygments package ) and two lines in your "~/.bashrc"
sudo apt-get install python-pygments
Make "less" use it by editing "~/.bashrc" and adding these to the end:
export LESSOPEN='|pygmentize -g %s'
The first line is to make sure that ANSI color escape sequences are output in raw form when using "less".
The second line is to allow pygmentize to preprocess the content before being passed on to "less" and "-g" flag will ask pygmentize to decide which syntax to use based on file content
Save the file then run this to start using it right away: