less + syntax highlight > less

less is a terminal pager program on Unix, Windows, and Unix-like systems used to view (but not change) the contents of a text file one screen at a time.

To add syntax highlighting to less on linux, first install source-highlight, then copy the following snippet to your ~/.(bash|zsh|fish|etc)rc file:

# The following adds syntax highlighting to various programming languages
# Credit goes to Ter Smitten: https://goo.gl/64YU4u
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '

# The following adds syntax highlighting to man pages
# Credit goes to Todd Weed: https://goo.gl/ZSbwZI
export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\e[0m' # end mode
export LESS_TERMCAP_se=$'\e[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[37;44m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\e[0m' # end underline
export LESS_TERMCAP_us=$'\e[04;38;5;146m' # begin underline

If you’re interested in reading about the differences between more, less and most, read Evan Teitelman‘s answer on StackExchange.

After reading more about less, I feel I’m just scratching the surface.
I love it that each day I learn how much I don’t know!