Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

Showing line numbers on vim

Date: 2008-05-20 00:00:00 -0400

Sometimes you really need to see the number of the line where you are while editing a text file, if you like vi / vim, this will help you how to turn on and off the numbering of lines.

Turn on the number display on vim

While editing the file enter:

:set nu

or

:set number

Turn off the number display on vim

While editing the file enter:

:set nonu

or

:set nonumber

Printing the numbers

Sometimes you want to print those numbers, specially if you are debugging software, so enter:

:set printoptions=number:y

Note: Remember that you can always put these commands in your $HOME/.vimrc in order to have them as defaults

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.