VIM open, cursor Movement, edit mode, normal mode, command mode toggle command
1. Cursor movement in the screen text can use both the keyboard and the left and right arrow keys, you can also use 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.
2. To enter the Vim editor, enter in the terminal: VIM (note that the first colon is not the input, the same as the same) or with VIM to open the existing file, enter: Vim file name < carriage return, such as the use of vim to open the hello.py file,
Then enter in the terminal: Vim hello.py < Enter >
3. 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>
4. 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