Printing from vi

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



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s