I would like to have the colors the gruvbox coloring scheme for (g)vim uses in a lstlisting environment. Is the listings package too dumb to differentiate e.g. between "template", "const" and other keywords so they all get the same color?

  • in my experience listings can be manipulated to do pretty smart (or dumb) things. You can try with morekeywords or with some text replacement for const or template. Maybe if you put a screenshot of the desired colors and the code we can help. – alfC Mar 9 '16 at 4:52

Listings only has quite a simple pattern matcher designed to distinguish keywords from punctuation etc. The minted package is more powerful (but requires shell-escape to use an external parser). Minted uses the python pygmetize syntax highlighter, for which there appears to be a gruvbox-style customisation here


  • My documentation currently uses \begin{lstlisting}[style=...] and \listinline|...| everywhere. Is it easy to go from listings to mint in regards to an existing documentation that already uses listings? – apriori Mar 8 '16 at 22:58
  • @apriori try one with minted and if you like it then it's only a global replace in your editor to change them all, or just some, you can load both packages. – David Carlisle Mar 8 '16 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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