Show line numbers in vi or vim

Contributor Icon Contributed by Rex Date Icon February 16, 2004  
Tag Icon Tagged: UNIX

Displaying line numbers while editing a file can be handy. This recipe describes how to turn on and off the display of line numbers in vi and vim.


While editing a document (and not inserting text), type the following to turn on line numbers:

:set number

If you tire of the line numbers, enter the following command to turn them off:

:set nonumber

Previous recipe | Next recipe |
 

Viewing 7 Comments

 
close Reblog this comment
blog comments powered by Disqus