vim Normal mode, insert mode, command mode switchVIM open, cursor Movement, edit mode, normal mode, command mode toggle command
The cursor can be moved in the screen text using either the left or right arrow keys on the keyboard or the HJKL letter key.
H (Shift left) J (downlink) K (upstream) L (shift right)
Use the HJKL letter key must ensure that Vim is in normal mode, if it is input mode, the letter key will not be used. Press the ESC key to return to normal mode.
When you want to enter the VIM editor input: Vim file name < Enter >
How do I get into insert mode?
- A insert the content after the cursor
- A inserts the content at the end of the line where the cursor is located
- I insert content at cursor location
- I
- s removes the character at the cursor and then enters insert mode
- S
- CW Delete the character from the cursor position to the end of the word before entering insert mode
- o Enter insert mode below the line where the cursor is located
- O Enter insert mode on the top of the line where the cursor is located
In normal mode, start inserting text at the cursor position.
Input I enter the necessary text.
Enter lowercase o to open a new line below the cursor and place the cursor at the beginning of the new opening and into insert mode.
Enter an uppercase O to open a new line above the cursor and place the cursor at the beginning of the new opening and into insert mode.
Enter lowercase A To insert text after the cursor position. Enter uppercase A to insert text after the end of the line in which the cursor is located.
Exit edit mode back to normal mode press <ESC>
To exit the Vim editor, go back to Normal mode, enter:: (the second colon is keyboard input) back to command mode, enter the following command at this time:
<ESC>: q! < Enter > here the colon is required to enter, this is not saved modified exit mode
Or, enter the following command to save all changes:
<ESC>: Wq < Enter > or: x, where the colon is required
Basic operation of Vim