Skip to content

Instantly share code, notes, and snippets.

@sramam
Created September 22, 2014 18:50
Show Gist options
  • Select an option

  • Save sramam/8a65efeb4d483471b5b9 to your computer and use it in GitHub Desktop.

Select an option

Save sramam/8a65efeb4d483471b5b9 to your computer and use it in GitHub Desktop.
highlighted source code from the command line
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