How To Show Line Numbers In VIM (VI) Editor
To Turn On Line Numbers In VIM
To see line number when using VIM (VI), which have no impact on your file content and used for guidance, do the following:
- Open a file with VIM.
- Enter
:set number
or:set nu
.
To Turn Off Line Numbers In VIM
To no longer see the line numbers show in VIM, then do the following while using the VIM (VI) editor:
- Enter
:set nu!
.
To Make Line Numbers Be On Every Time You Start VIM
To make the line numbers show automatically when you edit a file with VIM, then do the following:
- Edit your user's profile .vimrc file or make a new .vimrc file using VIM
vi ~/.vimrc - Scroll to bottom of file >> and Go into Insert Mode by pushing i on your keyboard >> and add this line:
set number
- Save and Close the .vimrc file:
Enter:wq
.
Feel Free To Leave A Good Comment. :)
Look around, and you may find other useful articles.