5

I found pygmentize thanks to this answer, but it would be great if it could be used to highlight text with less or maybe replace the command.
Is there a way to do that? Thanks in advance.

Alter Lagos
  • 1,159

2 Answers2

6

It was easier than I expected. I must to use:

export LESSOPEN='|pygmentize %s'
Alter Lagos
  • 1,159
1

Yes, of course:

pygmentize -g /file/to/show | less -r
kiri
  • 28,246
  • 16
  • 81
  • 118