Created
June 15, 2011 14:28
-
-
Save danreedy/1027224 to your computer and use it in GitHub Desktop.
A Textmate bundle command for printing to preview from Textmate with syntax highlighting.
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
[ -n "$TM_FILEPATH" ] && \ | |
PDF_FILE=~/Desktop/`date "+%y%m%d%H%M%S"`_`basename "$TM_FILEPATH"`.pdf | |
PS_FILE=/tmp/`basename "$TM_FILEPATH"`.ps | |
vim \ | |
"+set number" "+syntax on" "+color slate" \ | |
"+set printoptions=number:y" \ | |
"+set printfont=consolas:h7" \ | |
"+hardcopy > $PS_FILE" "+q" \ | |
$TM_FILEPATH &>/dev/null && \ | |
ps2pdf $PS_FILE $PDF_FILE && \ | |
rm $PS_FILE && \ | |
open $PDF_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment