219,245 views
4 votes
4 votes
A new programmer often uses the vi editor to create scripts and often has a need to view lines as numbered in the vi editor. What advice do you provide?

User Katrash
by
3.7k points

1 Answer

3 votes
3 votes
Answer: Press ‘ESC’ and then ‘:’ and type ‘set number’

-> :set number

Step-by-step explanation:
ESC being you into command mode and the colon specifies the command and you want to “set” line “number” so you type :set number. To remove line numbers, simply do the same thing but type nonumber instead of number.

Cheers.
User Henok Tesfaye
by
3.3k points