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:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 4 comments… read them below or add one }
Great tip, thanks guys (and google)
Awesome!
What is great tip , it working good.
what a great tip, it’s working…