In VI/vim, copy and use "Y" and delete with "D". What about the clipboard? The clipboard is deleted and then pasted. The original deletion is not a real deletion, but a buffer.
Copy
1. In "YY" editing mode, copy the content of the row where the cursor is located.
2. In "nyy" editing mode, copy a total of N rows starting from the row where the cursor is located.
3. ": N1, n2y" in command line mode, copy the content of all rows starting with N1.
Delete
1. "DD" deletes the content of the row where the cursor is located.
2. "NDD" deletes n rows starting from the row where the cursor is located.
3. ": N1, n2d" deletes the content of all rows ending with N2.
Clipboard
After a delete operation is executed, press "p" to paste the cut content under the row where the cursor is located.
Others
1. ": n1con2" copy the content of Row-marked N1 to the bottom of Row-marked N2.
2. ": N1, n2con3" copies the content between the row-marked N1 and N2 to the row-marked N3.
3. ": R file name" copies all the content of the file to the current file and inserts it under the row where the cursor is located.
Undo
1. "U" undo the previous operation
2. ": E! "Return to the state when the file is loaded (the premise is that the file has not changed outside VI after the file is loaded), the essence is to load the file from the hard disk. This is useful when editing files in multiple ways.