To show line numbers in Vim by default on Linux, you can add the following line to your ~/.vimrc
configuration file:
set number
This will enable line numbering every time you start Vim.
Alternatively, you can also enable line numbering within Vim by using the :set number
command. This will enable line numbering for the current session only.
You can also customize the formatting of the line numbers by using the 'number'
option. For example, to set the line number format to 'nnn. '
, you can use:
:set numberformat=nnn.
You can find more information about line numbering in Vim in the Vim documentation by typing :help number
within Vim.