Linux system common commands (3) how to display the number of lines in vi or vim editor

How to display the number of lines in vi or vim editor

Temporary display

In the last line mode of vi or vim editor, enter " :set number "
Insert picture description here

Turn off temporary display

Similarly, in the last line mode of the vi or vim editor, enter set nonumber " :set nonumber "
Insert picture description here

Permanently display line numbers

Command vim ~/.vimrc
Insert picture description here
input " set number " and then " wq " to save and exit.
Insert picture description here
After entering the file again, the line number will be displayed directly
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_51613313/article/details/110952727