Thursday, August 13, 2009

how to print in vim without using the GUI

The command for printing in vim is hardcopy:


:[range]ha[rdcopy][!] [args]


range defaults to the whole file.
On Windows, the print dialog pops up unless you use !.
I hardly ever use args so I don't know anything interesting about it. :)

If you want to print line numbers like I sometimes do, use printoptions to control this.

Do the following to enable line numbers in the printout:


:set printoptions=number:y


Easy!

No comments: