Replication operations in Vim

Source: Internet
Author: User
Tags lowercase

yy copies the entire row of the cursor's row. or capitalize a Y.
2yy or y2y to copy two rows. Sunglass, please extrapolate well. :-)
y^ is copied to the beginning of the line, or y0. Does not contain the character where the cursor resides.
y$ is copied to the end of the line. Contains the character where the cursor is located.
YW copy a word.
y2w copy two words.
YG copied to the end of the file.
Y1G copy to the top of the file.
P lowercase p represents post to Cursor (bottom).
P Capital P is affixed to the front of the cursor (top).
The entire row is copied, pressed p or p to be inserted on the bottom (top) line. A copy of a non-whole row is posted after the cursor is located (before).

"Ayy copies the line to a buffer
A can be one of 26 English letters, if it is lowercase, the original content will be cleared away, if it is uppercase words is the role of append, will attach content to the original content.
"Is the same as the one next to the ENTER key (ditto marks)."

The AP pastes the contents of the a buffer.
The terminology of the buffer in vim called Registers,vim expands quite a lot of functionality, and interested in deep friends please: H registers. The content you have changed or deleted with instructions such as D, C, S, x, Y is placed in the registers. For example, a line that you delete with DD can also be labeled with P. As long as the contents of the buffer can be used to paste, not necessarily Y content to use p. So you think P is paste also can, think is put may be more correct. 5 "Ayy copy five elements to a buffer."

5 "Ayy again copy five elements attached to a content, now a has 10 lines of content."
Sunglass No, I always use a. You think only a can use it. 26 English letters can be, cross use, you will find VI (m) magnanimous is not small.
Here's the problem. What to do when you forget who is who. : Reg (Colon command) will list all the registers code and content. You should try to click now. Hey. How can there be a number of words, special symbol of the buffer, the original you have just deleted (copy) of the contents of the preset placed in "This buffer, and then sequentially is 0,1,2,... 9. That is, if you press P not Gash, it is to remove the contents of the buffer. % refers to the file currently edited, # refers to the previous edited file. There's something else. Because nothing important, please: H registers bar. Registers has an "s" ending, do not make a mistake, and the key to the Tab button Vim also support, that is, you type: H Regi and then press the TAB key, VIM will help you fill the whole, press the tab after the discovery is not what you want, then continue to press, there will always be you want. :-)
Tab complement function, Elvis also have, but call out the Registers List command is not, you have to own memory in your head melon seeds. And Elvis's ability to fill the full capacity and not vim strong.

In addition, press the V button, you can enter the visual mode, this time can be more free and flexible to select the paragraph to be copied, block.

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.