Enable Line Numbers in VIM

Mindwatering Incorporated

Author: Tripp W Black

Created: 06/21/2010 at 10:22 AM

 

Category:
Linux
Utilities

Often enough you'll need to debug something and would like to see line numbers.
To set just for the session, type:
:set number

To unset, type:
:set nonumber

This command is entered when you are not in insert mode.


To make this a permanent preference, edit your .vimrc file in your home directory.
(If you don't have one, create it, example: touch /home/myuserid/.vimrc )
Add the following on it's own line:
:set number

previous page

×