1. Select a text block. Using V to enter the visual mode, move the cursor key selection.
2. The command to copy is Y, which is yank (lifted), and the commonly used commands are as follows:
Y Copies the selected block to the buffer when a piece is selected using the V mode;
yy copy entire row (Nyy or yny, copy n rows, n is number);
y^ Copy the contents of the current to the wardrobe;
y$ Copy the contents of the current to the end of the line;
YW copy a word (NYW or ynw, copy n word,n to numbers);
YG Copy to end of file (NYG or yng, copy to Nth line, e.g. 1yG or y1g, copy to end of file)
3. The Cut command is D, that is, the delete,d is basically similar to the y command, so two command usages, including the use of a number.
D Cut the selected block into the buffer;
DD Cut Whole row
d^ cut to the beginning of the line
d$ cut to end of line
DW cuts a word
DG cut to the end of the gear
4. Paste the imperative p, that is put (put down)
P lowercase p represents the post to the cursor (bottom), because the cursor is at the position of the specific character, so it is actually behind the character
P Capital P represents the front of the cursor (top)
A copy of the entire row is pasted on the cursor (bottom) row, and the non-full row copy is pasted before (after)
Note:
In a regular expression, ^ represents the starting position of the matching string, and $ represents the end position of the matched string.
A command preceded by a number indicating the number of repetitions, plus a letter indicating the name of the buffer used. Use the English period "." You can repeat the previous command.
While copying and pasting, another set of commonly used commands is U (undo action), U (undo a row of all recent modifications), Ctrl+r (Redo), these functions are mainly in Vim, vi slightly different
Vim copy and Paste commands