Enter your email address:

Delivered by FeedBurner

Showing line numbers on vim


StumbleUpon Toolbar

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

Trackback URL for this post:

http://www.go2linux.org/trackback/494
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

to toggle use :set nu!

to toggle use
:set nu!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting