Robert Cussons wrote:
Hi all,

sorry if this is blindingly obvious to all but me but I am having some problems printing from vim. I looked under :help print and the harcopy section and I can get what I want to print to the correct printer. I have syntax highlighting on (I was printing some C code) and this seems to come out (sort of) but as I have the background set to black, the code is also printed on a black background, is there a way to change this just for printing, i.e. could I set up a profile with different syntax highlighting and background etc. that would be sent to the printer, or even just black on white, although I would prefer the highlighting to be preserved in one form or another. Or is there an easier way that I am missing entirely?

Thanks in advance,
Rob.


see ":help 'printoptions'"

I don't think it's possible to use a /different/ syntax highlighting, but you can print with /no/ syntax highlighting (i.e., black on white) by making sure that 'printoptions' contains "syntax:n" (without the quotes). One way to do that is to type

:set printoptions=<Tab>

The current value will appear on the command-line (with escaping backslashes if and where needed, if any). You can edit it there with arrows, backspace, delete, type-in, etc.; then end the edit by <Enter> (to accept the changes) or by <Esc> (to abandon the changes). If you want to set the changed value every time you run Vim you will, of course, have to add the proper "set" command to your vimrc.


Alternately, you can /set/ different highlighting colors by using a color scheme (see ":help :colorscheme"). Make sure that you use a color scheme with a bright background and dark text. Or else, view the file in the GUI, which uses black text on white background by default, but requires a windowing system such as Windows, Macintosh or X11 ("bare bones" Unix without X11 won't do). You can then print with the same highlighting, but it will (at least temporarily) display (mostly) dark text on a bright background on your terminal too.


Best regards,
Tony.

Reply via email to