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. To do so:
- Press the
Esckey if you are currently in insert or append mode.
:(the colon). The cursor should reappear at the lower left corner of the screen next to a
- Enter the following command:
- A column of sequential line numbers will then appear at the left side of the screen. Each line number references the text located directly to the right.
To turn off line numbering, again follow the preceding instructions, except this time enter the following line at the
Entry filed under: Uncategorized.