How To Show or Hide Line Numbers In vi / vim Text Editor

How To Show or Hide Line Numbers In vi / vim Text Editor

To show line numbers in the vi or vim text editor, you can use the :set number command. This command will enable line numbering in the editor, and the line numbers will appear on the left side of the editor window.

To hide line numbers in vi or vim, you can use the :set nonumber command. This will remove the line numbers from the editor window.

You can also use the :set number! command to toggle line numbering on and off.

These commands can be entered in normal mode (not in insert mode). You can also add them to your vimrc configuration file to make them persist across sessions.

For example, to show line numbers every time you open vim, you can add the following line to your vimrc file:

set number
Sour‮w:ec‬ww.lautturi.com
Created Time:2017-10-29 22:08:32  Author:lautturi