I use putty as a terminal to connect my remote server through ssh.

Vi is my favorite text editor in it.

How to display line numbers along the left side of the editor?

Enter following command while using vi text editor

:set nu

It will looks like as below:

vi-text-editor with line number

 

To turn off the display of line number, try

:set nu!

But most of time, I would like to set it up and keep line number display as default

How to do it?

vi ~/.vimrc

Add following line

set number

Save and close the file.

David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

Leave a Reply

Your email address will not be published. Required fields are marked *