Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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.

share|improve this question

marked as duplicate by guntbert, Eliah Kagan, Eric Carvalho, Radu Rădeanu, BuZZ-dEE Jan 21 at 7:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 2 down vote accepted

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

export LESSOPEN='|pygmentize %s'
share|improve this answer

Yes, of course:

pygmentize -g /file/to/show | less -r
share|improve this answer
    
Maybe I wasn't enough clear in my question, but I was expecting to replace less for pygmentize.Thanks anyway –  Alter Lagos Jan 16 at 0:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.