I used to use listings a lot but minted+pygmentize has outstanding output. However, there are a few features from listings that are hard to find in minted, like having the line numbers on the right.
Is there a way to cross reference lines in a minted environment as in listings?
mintedusesfancyvrb, so the documentation offancyvrbwill help you.+ – Marco Daniel Mar 4 at 19:24texcl=trueto allow LaTeX in comments, and then put a\labelin a comment and\refthat. Unfortunately, Pygments doesn't allow LaTeX anywhere except for comments (though that feature has been requested). So Pygments is a bit more limited thanlistingsin that respect. (You could always take the direct output of pygmentize and add\label's by hand, but that's probably not what you were looking for.) – G. Poore Mar 4 at 20:05