Three modes
-
General mode: copy, paste, delete, etc -
Edit mode: Press i or a To enter edit mode, press Esc Return to normal mode -
Command mode: Press / or ? or : To enter command mode, press Esc Return to normal mode
Move operation
h j k l : used to control cursor movement gg : Back to top G : Back to bottom :n : Skip to n lines (n is a number) ctrl+f and ctrl+b : Screen scrolls forward and backward 0 and shift+4 : Back to the beginning and end of this line
Exit Editor
:w and :wq : Save and Save Exit :q and :q! : Exit and exit without saving
Copy Paste
Copy Multiple Lines
yy , copy the current row nyy Where n is the number of rows to be copied, and n rows are copied downward
Copy Section
delete
dd : Delete the current row ndd : Delete the first n lines of the current line dG : Delete the current line from the beginning to the last line
Undo Redo
Comments and cancellations
notes
-
Press ctrl+v Enter visualization mode -
Move the cursor to select the line to be commented -
Press I , and then enter a comment such as # -
Press Esc Return to normal mode
cancel
-
Press ctrl+v Enter visualization mode -
Select the comment to delete -
Press d or x delete
search
set number