VIM tutorial, vim
Vim environment setting parameters
- : Set nu
- : Set nonu is to set and cancel the row number!
- : Set hlsearch
- : Set nohlsearch hlsearch is high light search ). This is to set whether to reverse the white value of the searched string. The default value is hlsearch.
- : Set autoindent
- : Is set noautoindent automatically scaled down? Autoindent means automatic contraction.
- : Does set backup automatically store backup files? Generally, it is nobackup. If backup is set, when you change any file, the source file will be saved as another file named filename ~ . For example, if we edit hosts and set it to set backup, hosts will be generated in the same directory when hosts is changed ~ File Name, record the original hosts file content
- : Set r do you still remember some descriptions of the status bar in the lower right corner? This ruler is displaying or not displaying the set value!
- : Set showmode: whether to display the status bar in the lower left corner of the -- INSERT -- or other words.
- : Set backspace = (012) in general, if we press I to enter the edit mode, we can use the backspace key to delete any character. However, this is not allowed for some distribution. In this case, we can set it through backspace ~ When the backspace is 2, you can delete any value. When the value is 0 or 1, you can only delete the character you just entered, but cannot Delete the existing text!
- : Set all displays all the currently set environment parameters.
- : Set displays the set parameters that are different from the default values of the system. Generally, you have set parameters that you have changed on your own!
- : Syntax on
- : Does syntax off show different colors based on program-related syntax? For example, when editing a plain text file, if it starts with #, the line turns blue. If you know how to write a program, syntax on will take the initiative to help you correct it! However, if you only write text files and want to avoid the interference of color on your screen, you can cancel this setting.
- : Set bg = dark
- : Set bg = light can be used to display different color tones. The default value is "light 』. If you often find that the font of the annotation is dark blue, you can set it to dark here! For details, there will be different styles!
The overall vim setting value is generally placed in the/etc/vimrc file. However, we do not recommend that you modify it! You can modify ~ /. Vimrc file (default does not exist, please manually create it !), Write the set value you want.
Example:
[Root @ www ~] # Vim ~ /. Vimrc "Double quotation marks for this file (") is the annotation set hlsearch "High Brightness anti-white set backspace = 2" can be deleted at any time with the backspace key set autoindent "automatic contraction set renders" can display the status of the last row set showmode "in the lower left corner of the line status set nu "displays the row number at the beginning of each row! Set bg = dark "show different background colors syntax on" syntax test, color display.
Common VIM commands
1G: equivalent to moving gg to the first line of the file G: moving to the last line of the file p (lower case): paste P (upper case) at the next line of the row where the cursor is located ): paste the last line of the row where the cursor is located