Created
October 10, 2012 13:25
-
-
Save polarblau/3865638 to your computer and use it in GitHub Desktop.
Copy&paste highlighted code into e.g. Keynote
This file contains 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
# 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