A brief introduction to the interoperability of vim and system pasteboard

Source: Internet
Author: User

This problem has been frequently encountered recently, recorded here.

My environment
    • SystemArchlinux
    • VimNVIM v0.2.2 / vim 8.0.1297
Premise

Requires VIM support+clipboard

    • Check methodvim --version | grep clipboard
    • If you are using unsupported vim-minimal , installation gvim can be solved, the command line version will also support after installation
    • As for Nvim, I'm not quite sure, as if VIM supports it???
Begin

No longer details of Vim's copy-and-paste cache system, only introduction to the method, in particular, can refer to a variety of detailed information on the blog

    1. Copy from Vim to system pasteboard

      • Similar to using normal y commands, you "+y can copy content to the system pasteboard only
    2. Copy from System Pasteboard to Vim

      • Method 1: p Similar to the command, you only need to replace the "+p
      • Method 2: First vim input command :set paste (so that the paste effect is good, no strange indentation), insert mode using the terminal paste function
    3. Replication between multiple Vim

      • If it is the same vim process with different buffer, can be directly p / y without problems
      • If it is a different process, it can be done as mentioned above, that is +寄存器 , the previous"+y / "+p
Finally, say something.

In simple terms, you can follow: < double quotes >< register name >< command > To use different vim registers, and the command to view registers is:reg

I'm just going to take a note of the simple procedure, the principle of vim register is interested in reading the vim of the document and a variety of blog bar ~

A brief introduction to the interoperability of vim and system pasteboard

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.