Enter VIM
If you want to open or create a new file/home/eagle/main.cpp, enter the statement:
Vim/home/eagle/main.cpp
Move cursor
Key |
function |
0/home |
Move to the beginning of the line |
$/end |
Move to end of line |
+ |
Move to the beginning of the next line |
- |
Move to the beginning of the previous line |
Key |
function |
H |
Move to the top of the screen line |
M |
Move to the center of the screen line |
L |
Move to the bottom line of the screen |
Insert Content
Key |
function |
I |
Insert before the cursor |
A |
Append after cursor |
I |
Insert at the beginning of a line |
A |
Append at the end of a line |
O |
Open a new row in the next line where the cursor is located insert |
O |
Opens a new row in the position of the cursor at the previous line insert |
Exit Vim Save exit
You can choose one of the following three ways:
- Press ESC, input
:wq
, enter
- Press ESC, input
:x
, enter
- Press ESC, press SHIFT + ZZ, enter
Normal exit
The prerequisite is: The Open file content has not been changed
Press ESC, input :q
, enter
Do not save exit
Press ESC, input :q!
, enter
Force exit
Press ESC, input :!
, enter
After exiting, there will be a prompt message 请按ENTER或其他命令继续
.
The VIM editor uses