Skip to content

Instantly share code, notes, and snippets.

@polarblau
Created October 10, 2012 13:25
Show Gist options
  • Save polarblau/3865638 to your computer and use it in GitHub Desktop.
Save polarblau/3865638 to your computer and use it in GitHub Desktop.
Copy&paste highlighted code into e.g. Keynote
# I came across this snippet http://gistflow.com/posts/422-highlight-code-for-keynote-presentation
# but it didn’t work until @pietia was so nice to point out that there’s no need for the output file.
# 1. Install highlight
brew install highlight
# 2. Add this to e.g. .bash_profile and reload it
function hl() {
 format=${1-rb};
 pbpaste | highlight --syntax=$format -O rtf | pbcopy;
}
# USAGE:
# Copy e.g. some Javascript (Ruby is default) code and run
$ hl js
# paste it nicely highlighted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment