Copy file content across multiple VI Terminals

Source: Internet
Author: User
Copy file content between multiple VI Terminals-Linux general technology-Linux programming and kernel information. For more information, see the following. Linux does not have the clipboard as common as windows does. Therefore, it is necessary to copy the file content between multiple VI terminal windows. One method is to use a file for transfer. The principle of the following code is as follows. Add the following two lines of code to your. in vimrc, a label is defined when VI is used (for example, mm defines label m ), in command line mode, use C m to copy the file content between the label m and the current line, and then paste it with V on another terminal. This method is feasible in any linux or Unix environment.

Code (in the Vim 7.1 environment ):
Command-nargs = 1 C: ',. w! $ HOME/. vimbuf
Command-nargs = 0 P: r $ HOME/. vimbuf
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.