Copy content between two different vim

Source: Internet
Author: User

The conventional idea is to open two vim and then do the YY and P operations, but the practice proves that it doesn't work at all. At this point, we need to split the window and then we can copy and paste. The steps are as follows:

Suppose I want to copy the ReadLine function of the srv.c file to the Cli.c file as a whole.
1. Split: Open srv.c at this point, then enter SP under command interface

2. Open: Enter e cli.c, this opens the CLI.C

3. Switch window: ctrl+w+ the arrow keys (up or down) to switch windows.
4. Make a valid copy: If you want to copy a function to another window, you can do the following

    • Find the beginning: "{" To find the function entry or exit, enter shift+v into the visualization mode
    • Pull the mouse wheel to the end of the function you want to copy
    • Make a regular copy of YY
    • Ctrl+w+ arrow keys (up and down) switch back to CLI.C, select the appropriate location, paste P

Original link: http://blog.csdn.net/u010296036/article/details/70591639

Copy content between two different vim

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.