Syntax and Log-highlighting - less isn't more on Xterm

quick-tip
shell
Tags: #<Tag:0x00007f0ca7bbc820> #<Tag:0x00007f0ca7bbc6b8>

#1

Syntax-highlighting - inline

Using the source-highlight package

λ ~/Source/ brew install source-highlight
λ ~/Source/ export LESSOPEN="| /path/to/src-hilite-lesspipe.sh %s"
λ ~/Source/ export LESS=' -R '
...
# Now we can use less or use the tool directly:
λ /var/log/ /usr/local/bin/src-hilite-lesspipe.sh test.py
λ ~/Source/cloudflare/ /usr/local/bin/src-hilite-lesspipe.sh test.json| less +F
# etc. etc.

Log-highlighting

Use the generic colouriser (grc)

λ /var/log/ brew install grc
λ /var/log/ grc tail -f system.log

36