Sometimes the default Vim environment is not suitable for your requirements, and we can adapt to our needs by modifying Vim settings such as fonts, colors, auto-indentation, and so on.
The usual setup parameters are as follows:
: Set Nu
: Set Nonu sets and cancels line numbers
: Set Hlsearch
: Set Nohlsearch to find whether the string is anti-white display
: Set all to display all environment parameter setting values
: Set displays settings parameters that differ from system default values
: Set autoindent Auto Indent
: Syntax on
: syntax off whether to display different colors according to different program-related syntax
: Set Bg=dark
: Set Bg=light sets a different tone
In addition,: Highlight can display, set specific color rules
These settings can be set directly in the file opened with Vim, immediately, but after exiting the settings will not have, if we want to make these settings permanent, then we need to use the following to modify the Vim configuration file.
The system has configuration file/ETC/VIMRC on the VIM environment settings, but it is best not to modify the system configuration file, because it will sound to all users of the VIM environment. We can set our own VIM environment in the ~/.VIMRC of our own home directory, the file does not exist, need to create vim ~/.VIMRC
If I want to make the VIM environment default to display line numbers automatically indent, yan * * * dark, then my ~/.VIMRC can be set
Set Nu
Set Autoindent
Set Bg=dark
Save the exit and then use the command source ~/.VIMRC to have the configuration take effect immediately, when we re-use VIM to edit the file, we will find that the VIM environment has been modified
This article is from the "Luohaizi" blog, make sure to keep this source http://597881426.blog.51cto.com/6819945/1686768
Talking about VIM environment setting