1. Normal mode (Normal-mode)
The default is in normal mode when Vim is started. Regardless of the mode, press the <Esc> key (sometimes required to press two) to enter normal mode.
2. Insert mode (Insert-mode)
Pressing I, I, a, a, and so on in normal mode (detailed in the following series) will enter the insert mode.
Now just remember to press the I key to insert mode. In insert mode, the corresponding character is written when the keystroke is clicked
3. Command mode
In normal mode, press the: (colon) key to enter command mode. In command mode, you can perform
Some inputs and executes some of the instructions provided by VIM or plug-ins, just as in the shell. These directives include
Setting up the environment, file actions, invoking a feature, and so on.
Commonly used commands are: Q (exit), q! (Forced exit), W (save), Wq (Save and exit
4. Visual mode (visual)
The visual mode is simply to select an edit area and then perform some actions on it, such as delete, replace, change case, etc.
In normal mode press V (character text, character selection text), V (line text, line-by-row selection text), <CTRL>+V (block text, select text according to block), you can enter visual mode. In visual mode
The operation is a bit like taking the mouse to operate, the choice of text when there is a mouse to select the visual sense, sometimes very convenient.
D Delete selected text
C Modify selected text
R Replace selected text
I inserts before the selected text
A Insert after text is selected
Gu selected area to lowercase
GU selected area to uppercase
g~-Case Intermodulation
> Indent one unit to the right
< indent one unit to the left