VIM simple tutorial (4) VIM simple tutorial (3) http://www.bkjia.com/ OS /201303/194220.html Lesson 4 Basic copy, paste operations cut and paste www.2cto.com when using the command d or x to delete a piece of text, the deleted text is automatically saved to a special clipboard by vim. Then you can use the p command (put) to paste it behind the position where the cursor is located. You can try to enter the following two commands in sequence: The ddp commands are executed to change the two lines of content. Similar to the following command, xp reverses the two letters. The www.2cto.com p command can also add a number to the front to repeat n times. Labels are added to the text. Sometimes, we need to delete a large text block. It is difficult to describe the start and end of the text block directly using the d command. In this case, you can use the m command (mark) to make a mark in the text. Let's take a specific example. For example, the following text is available: int main (void) {double x = 1e-2; double y [5]; y [0] = gsl_log1p (x ); y [1] = log1p (x); y [2] = log1p2 (x); y [3] = log1p3 (x ); y [4] = log (1 + x); printf ("gsl_log1p = %. 15e \ n ", y [0]); printf (" log1p = %. 15e \ n ", y [1]); printf (" log1p2 = %. 15e \ n ", y [2]); printf (" log1p3 = %. 15e \ n ", y [3]); printf (" log (1 + x) = %. 15e \ n ", y [4]); return 0;} You want to delete several printf statements. First move the cursor to the first character p of the first printf statement. Run the ma command. A is the name of the tag. The naming rule is the same as that of the q command. Then move the cursor to the first character r of the return Statement. Enter the command d'. Several lines of printf statements are deleted. 'A indicates the mark position. 'A indicates the start position of the row where the mark is located. When we make multiple marks in an article, we may not be able to remember where all the tags are. In this case, you can use the following command to display all the tags.: Marks, we can see that in addition to our defined tags, there are also many custom system-defined tags. Their meaning will be introduced later. In the Copy command Vim, the copy operation is called yank. The corresponding command is y. The y command is similar to the d command, except that it does not delete the selected region.