Pygmentize Styles

2020-07-26 133 words 1 min read

I have recently started using pygmentize for looking at my code in terminal. A very good and native way to do this is to use pygmentize. If you do not know about pygmentize then

Highlight the input file and write the result to . If no input file is given, use stdin, if -o is not given, use stdout.

So, you can simply pass the script or source code through pygmentize and get a lovely color output with code highlighting in the terminal and this can be very useful.

And you can use different style. You can use the following code to see all the available styles.

pygmentize -L | sed -n '/Styles/,$ p' | \
  grep '^*' | sed 's/^..\(.*\):/\1/' | \
  tr '\n' ' '

Hope this helps.


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it