Vim-copy/paste

Source: Internet
Author: User

Vim-copy/paste

1. Vim internal clipboard

(1) use the default Clipboard ""
Y → copy. You must specify a range, for example, YW.
Y → equivalent to YY. Copy the current row.
P → paste it behind the cursor.
P → paste in front of the cursor.

(2) Specify the register

"(Register) y (range) → put the content to be copied into the specified register. Register includes all numbers and letters; range is the range, such as W and Y. You can also use the visualization operation to select the content to be copied and then copy it.
"(Register) (times) P → paste the content of the specified register behind the cursor. Times specifies the number of times to be pasted.

2. Vim system clipboard

Sometimes, if we want to copy and paste the content of other applications to VIM, or copy and paste the content between vim, we need to use the system clipboard. In addition to VIM, you can use Ctrl + insert to copy the selected content to the clipboard and use Shift + insert to paste the content. You can also directly select the content to be copied and then copy the content to the cursor by pressing SHIFT + insert or in the middle of the mouse.

"+ Y (range) → copy the selected content to the system clipboard, and paste it into other vim. It is worth noting that it cannot be pasted into other applications.
"+ (Times) P → paste the content in the system clipboard to the current cursor.

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.