Because of my personal preference, I like to set the background color to dark when I use VIM.
But each time you open a vim to reset it, it feels very troublesome.
Always enter [ESC]: Set Bg=dark is inconvenient
The rough way is to go directly to the/etc/folder to modify the configuration file, as follows, but this method is not recommended,
Because the file under the/etc/folder requires root permission to modify, and once the error is changed the whole system is prone to problems
Method One:
CentOS, for example, has a configuration file path of/ETC/VIMRC (/ETC/VIM/VIMRC different versions, may not be the same)
Get root Permission First
Su
Enter the root password
Then open the file
Vi/etc/vimrc
Find out if a set BG setting is already in the file
/bg
Not found, default background set to light
Add Background Settings command (remember to add comments):
Set Bg=dark "Set background color as dark. It can also is changed as light
Exit Edit
: Wq
Method Two:
Create a Vim environment settings file in the current user's home directory, write the parameters that need to be set
[Email protected] ~]$ VI ~/.VIMRC
Set Nohlsearch "Non-high brightness anti-white
Set autoindent "Auto Indent
Set ruler to show the status of the last row
Set Showmode "The bottom left corner of which line of state
Set Nu "can display line numbers at the front of each line
Set Bg=dark "background setting to Black
Syntax on "Grammar check, color display
Set vim default parameters such as setting the default background color