tags:

views:

377

answers:

3

Sometimes I work with a file that contains source code, columns, plain text, sometimes all 3. It looks great on the screen. However, when I send it to a printer, it comes out a mess: columns/tables are misalignment, code looks like a spaghetti, etc.

I use vim editor (7.2). How do I reformat the file to please the printer?

Perhaps I should shorten the length of a line?

thx

+2  A: 

How do you send it to printer? Try :hardcopy command.

You can also lookup printing-related options printfont, printdevice, printoptions, etc.

See also printoptions and others on vimdoc.sourceforge.net

Michael Krelin - hacker
send it from console: lpr
vehomzzz
Then really do try `:hardcopy` from `vim`. you can try `hardcopy>file.ps` first to preview.
Michael Krelin - hacker
How do I use printfont, printdevice, printoptions?
vehomzzz
`:help printfont`, `:help printdevice`, `:help printoptions`.
Michael Krelin - hacker
not available :(
vehomzzz
First, I suggest that you install `vim` with help files. It sounds like you need it. Second, check this out: http://vimdoc.sourceforge.net/htmldoc/options.html#'printoptions'
Michael Krelin - hacker
+1  A: 

It's not a pure-Vim solution, but I've had good experiences with GNU a2ps for converting (relatively) poorly formatted text documents (a couple Project Gutenberg titles, to be specific) to a nice, printable pdf/postscript file.

Mark Rushakoff
A: 

I agree there is a problem. yim has 'formatoptions' to 'wrap' lines together the way you want and break lines at appropriate places ('linebreak', 'breakat') which would give you an elementary wysiwyg word-processing capability, except that it only works on the display and has no effect when sent off to print.

Robert