Created
September 22, 2014 18:50
-
-
Save sramam/8a65efeb4d483471b5b9 to your computer and use it in GitHub Desktop.
highlighted source code from the command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pbhighlight() { | |
| HTML=`highlight --inline-css -O html --style=tcsoft $@ | hexdump -ve '1/1 "%.2x"'`; | |
| osascript -e "set the clipboard to «data HTML${HTML}»" | |
| } | |
| which can be used as `pbhighlight file.java` to copy highlighted source to your clipboard for pasting. May require installation of "highlight" if that's not included, "brew install highlight" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment