1. Vim has a total of 4 modes:
- Normal Mode (Normal-mode)
- Insert mode (Insert-mode)
- Command mode (Command-mode)
- Visual Mode (Visual-mode)
Normal mode
The default is in normal mode when Vim is started. No matter what mode you are in, pressing the <Esc> button (sometimes pressing twice) will enter normal mode.
Insert mode
Pressing I, I, a, a etc in normal mode will enter insert mode. Now just remember to press the I key to insert mode. In insert mode, the corresponding character is written when the key is clicked.
Command mode
In normal mode, press the: (English colon) key to enter command mode. In command mode, you can perform some input and execute some of the instructions provided by VIM or plug-ins, just like in the shell. These directives include setting up the environment, file operations, invoking a feature, and so on.
Common commands are: Q (exit), q! (Forced exit), W (save), Wq (Save and exit).
Visual mode
Press V, V, <ctrl>+v in normal mode to enter the visual mode. Operation in the visual mode is a bit like taking the mouse to operate, select text when there is a mouse to choose the visual sense, sometimes it is very convenient.
Vi/vim use