vi / vim Print Line Numbers on Hardcopies / Printer

by Vivek Gite on April 12, 2008 · 4 comments

Q. How do I print line numbers on printer for my c / java code written using vi / vim text editor under Linux / UNIX operating system?

A. To print line number on screen and hardcopies such as printer type the following two commands while vim / vi text editor is open:

set number
set printoptions=number:y

Add above two commands to your ~/.vimrc file; so that settings get loaded everytime you start vim.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 4 comments… read them below or add one }

1 Giorgis May 31, 2008

Great tip, thanks guys (and google)

Reply

2 R March 4, 2009

Awesome!

Reply

3 venkatakumar November 12, 2009

What is great tip , it working good.

Reply

4 venkatakumar November 12, 2009

what a great tip, it’s working…

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 2 + 4 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: