Show line numbers in VI - Ubuntu Linux/Mac OS X
Posted 03-01-2012 at 11:02 AM by reverend27
From within VI
:set number
To make this behaviour the default:
user@machine:~$ cd ~
user@machine:~$ touch .exrc
user@machiner:~$ vi .exrc
Add the following line to the file:
set number
user@machine:~$ . .exrc
user@machine:~$ vi someTextFile.txt
Basically, if the file .exrc does not exist in your home directory create it.
Open .exrc for editing.
Add the line (w/o quotes) "set number"
Save .exrc
Source .exrc
Test to verify function.
~Fin
:set number
To make this behaviour the default:
user@machine:~$ cd ~
user@machine:~$ touch .exrc
user@machiner:~$ vi .exrc
Add the following line to the file:
set number
user@machine:~$ . .exrc
user@machine:~$ vi someTextFile.txt
Basically, if the file .exrc does not exist in your home directory create it.
Open .exrc for editing.
Add the line (w/o quotes) "set number"
Save .exrc
Source .exrc
Test to verify function.
~Fin
Total Comments 0