Skip to content

Instantly share code, notes, and snippets.

@pocotan001
Last active August 29, 2015 14:07
Show Gist options
  • Save pocotan001/a884ecbc9bcbc5f86c1a to your computer and use it in GitHub Desktop.
Save pocotan001/a884ecbc9bcbc5f86c1a to your computer and use it in GitHub Desktop.
Highlight a given file and copy it as RTF.
# requires highlight `brew install highlight`
function hlcopy() {
if [ -z "$2" ]; then
src="pbpaste"
else
src="cat $2"
fi
$src | highlight -O rtf --syntax $1 --style _${1} --font Menlo --font-size 38 | pbcopy
}
Description="CSS"
Default = { Colour="#ffffff" }
Canvas = { Colour="#ffffff" }
Number = { Colour="#ffffff" }
Escape = { Colour="#ffffff" }
String = { Colour="#ffffff" }
StringPreProc = { Colour="#ffffff" }
BlockComment = { Colour="#999999" }
PreProcessor = { Colour="#ffffff" }
LineNum = { Colour="#f49d62" }
Operator = { Colour="#999999" }
LineComment = BlockComment
Interpolation = Escape
Keywords = {
{ Colour= "#92bfbf" },
{ Colour= "#ffffff" },
{ Colour= "#f49d62" },
{ Colour= "#ffffff" },
}
Description="XHTML"
Default = { Colour="#ffffff" }
Canvas = { Colour="#ffffff" }
Number = { Colour="#ffffff" }
Escape = { Colour="#ffffff" }
String = { Colour="#ffffff" }
StringPreProc = { Colour="#ffffff" }
BlockComment = { Colour="#999999" }
PreProcessor = { Colour="#ffffff" }
LineNum = { Colour="#f49d62" }
Operator = { Colour="#999999" }
LineComment = BlockComment
Interpolation = Escape
Keywords = {
{ Colour= "#92bfbf" },
{ Colour= "#f49d62" },
{ Colour= "#f49d62" },
{ Colour= "#ffffff" },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment