vi / vim as well as nano are the most popular editors on Unix / Linux / Solaris and for hardcode Mac OSX users too. For developing / debugging we need line numbers. A way to get them to display line numbers doesn't jump out easily from their big documentation, so here are my simple tips on how you can display line numbers in vi / vim and nano editors.

How to display line number in vi / vim

:set number

How to stop displaying line number in vi / vim

:set nonumber

How to display line numbers in nano

Start nano with -c option:

nano -c

Frankly I prefer line number display like vi or jEdit. Unfortunately -c is as best as it gets on nano.

For hardcode developers on Linux who doesn't prefer to use fat resource hogging Eclipse or NetBeans, I recommend jEdit editor. Try it and you will start loving it.