Created
May 9, 2013 12:22
-
-
Save floere/5547133 to your computer and use it in GitHub Desktop.
Printing with line numbers, color, and wrapping into a PDF.
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
~/bin $ cat prettyprint | |
#!/bin/sh | |
PDF_FILE=/tmp/temp.pdf | |
PS_FILE=/tmp/temp.ps | |
vim \ | |
"+set number" "+syntax on" "+color slate" \ | |
"+set printoptions=number:y" \ | |
"+set printfont=courier:h9" \ | |
"+hardcopy > $PS_FILE" "+q" \ | |
$1 &>/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