[TxMt] Printing in textmate - hack solution

Jeremy Wilkins jeremy at ibexinternet.co.uk
Tue Apr 4 10:36:25 UTC 2006


Hi All,

I'm sure the printing will get improved in the future but for the  
minute I find it a bit limited (font size too big etc).

I've setup a command in the text bundle using a2ps (you can get this  
from darwin ports, probably fink and other places as well).

Save: Nothing
Command(s): a2ps --center-title=`basename "$TM_FILEPATH"` --font-size  
8 --pretty-print --columns 1 -M A4 -R --line-numbers 5 -o - - |  
ps2pdf14 -sPAPERSIZE=a4 - /tmp/textmate_print.pdf && open /tmp/ 
textmate_print.pdf
Input: "Selected Text"  or "Document"
Output: Discard
Activation: Key Equivalent - "Command P"

This will create a pdf called /tmp/textmate_print.pdf, and opens it  
in Preview (or acroread, or whatever your default pdf viewer is). If  
your happy with it you can just hit Command P to print it.

At the minute this prints in font size 8, but thats easy to change,  
it also prints in A4, if you change this you'll need to change both - 
M option to a2ps and the -sPAPERSIZE option to ps2pdf


jebw



More information about the textmate mailing list