Printing from viPosted: 25/01/2007
Okay, I admit, I’ve always been a vi lover. It must has something to do with the rather strange way of working, I’m not sure. But I’m sure that I was impressed when I noticed you can print from gvim. So I try to make it possible running the normal vim.
Printer device and paper options could be changed using this commands: “set printdevice=Virtual_Printer printoptions=paper:A4” and printing could be done using de ha(rdcopy) command but I had to print a list of files so I needed some automatisation.
First I modified my own vimrc (called ~/.vimrc) where I added `set printdevice=Virtual_Printer printoptions=paper:A4` so vim would use the correct printer with the correct options. This way, the first step for making a hardcopy was set up correctly.
But how could I automate vim? The manual pages gave me a good hint: use the ex-way. So printing a file called myfile can be automated running `ex +ha +q myfile`. Using the virtual PDF-printer resulted in a colorfull pdf-file in ~/PDF