Skip to content

Instantly share code, notes, and snippets.

@Vaysman
Forked from avdi/gist:9038972
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vaysman/9053305 to your computer and use it in GitHub Desktop.
Save Vaysman/9053305 to your computer and use it in GitHub Desktop.
# You will need the pygments and xclip packages
# This example highlights some Bash source code
# '-O noclasses=true' tells pygments to embed colors inline in the source
# the '-t text/html' option tells xclip what "target" to specify for the selection
pygmentize -l java -f html -O noclasses=true,encoding=utf-8 Main.java | pbcopy
# Another example
pbpaste | pygmentize -l ruby -f rtf -O noclasses=true,encoding=utf-8 | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment