Each time to the new machine to use VIM to modify the configuration file, you have to re-set the environment of vim, such as indentation, display line number, syntax highlighting, and so on, each time set, too troublesome, so find the data to write the usual settings in the home directory. vimrc file (default does not exist, need to create), as follows:
Vim. VIMRC
Set Nobackupset noswapfileset nohlsearchset numberset cindentset autoindentset shiftwidth=2set tabstop=2set softtabstop =2set Expandtabset Rulerset Mouse=vsyntax on
Common Setting Instructions:
Here are some of the settings that are commonly used in vim and their specific meanings:
set Nobackup: Do not back up files, use Backup to back up files (original file plus suffix ~).
set Noswapfile: Do not generate. swap files. I always have a habit before I edit a file, and I usually use it in the original
to a. Bak backup before you can confidently modify it on the relevant file. If the action cautious friend advises not to this
Item
Set Number: Displays line numbers.
set Cindent: Set C-style indentation and use Nocindent to cancel the setting.
set Autoindent: Set auto indent, each line is indented equal to the previous line, you can use Noautoindent to cancel the set
Reset
Set shiftwidth=2: Sets the indent to two spaces.
set tabstop=2: Set tab to two spaces.
set softtabstop=2: Set the Soft tab to two spaces.
set Expandtab: Indents and (soft) tabs use space overrides, which can be noexpandtab to cancel settings.
Set Ruler: Displays the row number of the cursor.
Set Mouse=v: If we use set Mouse=a to start all modes and block the right-click function of the mouse, then
This syntax allows you to use the right mouse button copy function in vim visualization mode.
syntax on: start syntax highlighting.
Keep this file (. vimrc) in place, and then the machine will be placed directly in the current user's home directory and renamed to. VIMRC, which makes it a lot easier to use.
This article is from the "Balich" blog, make sure to keep this source http://balich.blog.51cto.com/6641781/1760411
Customizing the template file for VIM usage environment