Vim provides powerful personalized functions, such as set nu, set ai, etc., but it is troublesome to type in command mode every time we open a file. In fact, vim can help us automatically set these when opening a file. Features.
Vim's default configuration file location ~/.vimrc
[root@localhost ~]# vim ~/.vimrc
Write the command to be executed
After saving and exiting, we can open the file with vim to automatically add the line number.
[root@localhost ~]# vim /etc/passwd
Of course, you can also add more commands, depending on your needs.