Xin Xing is playing with you to learn about the operation text in vim section 4. Xin Xing vim

Source: Internet
Author: User

Xin Xing is playing with you to learn about the operation text in vim section 4. Xin Xing vim

It is worth mentioning that the pdf version of my vim tutorial has been completed. You can download it. Here is the download of csdn: csdn. If the download fails on the left, you can also enter the following address in the browser to download: http://download.csdn.net/detail/xinguimeng/7714213, of course, if you are a loyal user of Baidu network disk, you can also use Baidu network disk, I also synchronized upload to Baidu network disk, below: Baidu Network Disk download, if the address is Hung, you can enter in the browser: http://pan.baidu.com/s/1sj9CLXz to download.

Following the preceding three sections, we will continue to learn some commands for operating the text content. These commands have a fixed mode: operator commands + displacement commands. First, we will enter an operator command, then we followed a displacement command, the so-called displacement command, which we explained earlier, that is, the command to move the cursor. For example, w indicates moving backward to the first letter of the first word, 4 W indicates moving backward to the first letter of the fourth self-word.

* ********************** Operator command *************** *****

1. Run the x command to delete a character. You can use 4x to delete four characters.

2. The d command is the first letter of "delete", indicating deletion. It is followed by a displacement command, indicating deletion. Dw means to delete a word, while d4w means to delete four words.

3. Both d4w and d4e can be deleted from the cursor and four words can be deleted. However, the difference is that d4w will delete the space behind it, and d4e will retain the space.

4. Because the $ command moves the cursor to the end of the line, d $ indicates that the content at the end of the line is deleted from the current position, and the last character of the line is also deleted.

5. The c command is similar to the d command, but it enters the insert mode after the command is executed. For example, the cw command First deletes the word and then immediately enters the insert mode.

6. the dd command deletes the entire line, while the cc command changes the line.

8. The c command can be understood as the first letter of the word "change", indicating "Modify, change ".

********** **********************

1. We can see that the x command and the dl command are the same. They both Delete the characters under the current cursor, and the X command is dh, indicating to delete the characters on the left of the current cursor. Sorry, let's talk about it. l indicates moving one cell to the right, and h indicates moving the cell to the left. This is what we learned in Section 2. Remember.

2. the D command indicates d $, indicating that the content is deleted to the end of the line, and C indicates c $, indicating that the content is modified to the end of the line, and s indicates cl, that is, modifying a character, S indicates cc, that is, a whole line of content is modified.


********************* **********

1. If the reader is a child shoes who like to shoes, then he will find that d4w and 4dw have the same effect. They all delete four words. Are they the same?

2. the answer is that the results must be the same, but the execution process is different. d4w deletes four words at a time, while 4dw deletes the dw that has been executed four times, delete a word each time.

3. In fact, we can use 4 d3w to delete three words each time. If the words are deleted four times, 12 words are deleted.


* ******************** Other commands *************** **********************

1. The r command is "replace", indicating that the character at the current position is replaced by the character we typed. For example, rx replaces the character at the current position with x.

2.5rx is replaced by x, which is a string of five characters after the character.



********************* *****************

1. This section describes common commands in vim. I won't be able to use them here, but the upload and insertion speed is too slow.

2. I suggest you download the pdf file that is recommended in this blog article, which provides more details.

3. Xin Xing vim, looking forward to your attention.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.