[plug] Pretty Printer

Peter Wright pete at cygnus.uwa.edu.au
Sun Oct 29 11:48:15 WST 2000


Hi Bill,

On Sat, Oct 28, 2000 at 07:33:45PM +0800, BillK wrote:
> a2ps looks like a very complex overkill as all I want is the c++
> syntax colour highlighting - not auto formatting which has the
> potential to destroy my code!  Downloading to tryout anyway, as
> nothing else has suggested itself so far, and I am not about to go
> highlighting by hand in staroffice! - wish I had the time to write
> some macro's tho.

You mentioned gvim in your first post, so I'll assume you've got a
working copy....

In the more recent versions of gvim, there is in fact a very nice menu
option which will produce a html file from the current buffer, using
<font> tags to highlight the text with the appropriate colour. You can
then save the file and open it up in a GUI browser (netscrape, etc.)
.... from which you may be able to print colour. For example:

1. open up blah.c in gvim, set appropriate syntax if it isn't set
   automagically
2. use menu option which will create buffer blah.c.html
3. save blah.c.html, then open it up in GUI browser.

Well I don't know about you - I've never been able to print colour
under linux, but then I've never really tried :-). Anyway, the above
technique is a very effective method of getting nicely
vim-style-syntax-highlighted code that can be viewed (and printed)
independently of vim.

Annoyingly, I don't have gvim from my current location, so can't refer
you precisely to the aforementioned menu option - however, I _think_
it's at the bottom of the "Syntax" menu (assuming there is a "Syntax"
menu, that is :-).

> BillK

Hope that helps,

Pete.
-- 
http://cygnus.uwa.edu.au/~pete/

--
hundred-and-one symptoms of being an internet addict:
210. When you get a divorce, you don't care about who gets the children,
     but discuss endlessly who can use the email address.




More information about the plug mailing list