How do I make the vi editor display or hide line numbers?
To make vi display line numbers, you need to set the number flag.
Press the Esc key if you are currently in insert or append mode.
Press : (the colon). The cursor should reappear at the lower left corner of the screen next to a : prompt.
Enter the command: set number
To turn off line numbering, again follow the preceding instructions, except this time enter set nonumber the : prompt:
Leave a Reply