Skip to main content
replaced http://superuser.com/ with https://superuser.com/
Source Link

I tend to disagree with Ingo, less can be taught to highlight syntax. Check out this answerthis answer on SuperUser. Basically, you have to install GNU's source-highlight (available in all major distro package repos), and then add the following to your .bashrc (or .bash_profile or what have you):

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

However, note that source-highlight is not as powerful as vim's highlighter. Use whatever suits you best.

I tend to disagree with Ingo, less can be taught to highlight syntax. Check out this answer on SuperUser. Basically, you have to install GNU's source-highlight (available in all major distro package repos), and then add the following to your .bashrc (or .bash_profile or what have you):

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

However, note that source-highlight is not as powerful as vim's highlighter. Use whatever suits you best.

I tend to disagree with Ingo, less can be taught to highlight syntax. Check out this answer on SuperUser. Basically, you have to install GNU's source-highlight (available in all major distro package repos), and then add the following to your .bashrc (or .bash_profile or what have you):

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

However, note that source-highlight is not as powerful as vim's highlighter. Use whatever suits you best.

Source Link
Felix
  • 463
  • 4
  • 11

I tend to disagree with Ingo, less can be taught to highlight syntax. Check out this answer on SuperUser. Basically, you have to install GNU's source-highlight (available in all major distro package repos), and then add the following to your .bashrc (or .bash_profile or what have you):

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

However, note that source-highlight is not as powerful as vim's highlighter. Use whatever suits you best.