How do I set line numbers in vim permanently?
You can show how to display or hide line numbers in Vim text editor using
set number command.
- To get the standard line numbering open your file in vim:
- Next press the
Esckey to switch to command mode in vim.
colon) and and type
set nuand hit the
Enterkey. For example:
- Line numbers will be displayed at the left side of the vim editor.
- To disable the absolute line numbers off type the following command. Press the
Esckey and type:
In short, to show line numbers in Vim text editor, use the
:set number command for absolute line numbers,
:set relativenumber for relative line numbers. For more info see the following: