Hacker News new | ask | show | jobs
by genman 844 days ago
Can less provide syntax highlighting?
2 comments

Sort of. Setting the LESSOPEN environment variable will filter less input through that, which could do syntax highlighting (if you use less -r).

The default (/usr/bin/lesspipe.sh, shipped with less) isn't very clever. It can uncompress files in some common formats and open images, but isn't very smart and doesn't handle markdown or code of any kind as far as I can tell.

It can with lesspipe but don't you think that's a bit of an overkill for a simple markdown document?