How to view line numbers in vi

28 Dec, 2007  |  Posted by Danesh  |  in HowTo, Linux

When editing large files in vi or vim line numbers become very important.

This is how you turn on/off line numbers in vi or vim.

Turn on line numbers

While vi is in edit mode and not inserting type the following

:set number

Turn off line numbers

While vi is in edit mode and not inserting type the following

:set nonumber

Screenshots

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
Tags: , , ,

3 Responses so far | Have Your Say!

  1. Irwan  |  December 28th, 2007 at 2:48 pm #

    My favourite (short cut mode), :se nu

    Irwan - Gravatar
  2. Danny  |  December 28th, 2007 at 3:21 pm #

    Thanks man :)

    Danny - Gravatar
  3. aizatto  |  December 28th, 2007 at 9:47 pm #

    If you want this to be permanent, you should enter it into your ~/.vimrc file. In fact go search online for .vimrc files, there are many good tips you can find in them.

    aizatto - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>