Go to VIM copy and paste Summary

Source: Internet
Author: User

I was learning how to use Vim. I wanted to learn Linux for a while and then suddenly found that Vim is a good thing to learn and use. Today I found that, you cannot use Ctrl + C/Ctrl + V to copy and paste data with other applications in the system. This is very unpleasant. I searched and found that many people wrote this question and tried a few times, I think this is the best thing. post it to favorites.

Address: http://lsong17.spaces.live.com/blog/cns! 556c21919d77fb59! 603. Entry

Content:

Using Vim for so long
But I still don't know how to use the system clipboard in Vim.CodeGedit is used to open the file, paste it in the middle and close it, and then use Vim to open and edit it.
Shuang; someone on the last Forum asked how to use the system clipboard in Vim. There were a lot of replies, but there were several pages of replies that didn't solve the problem, today, I can't stand it anymore. I tried to find a solution on the Internet and accidentally found it.
.

If you only want to use the system clipboard, you can press SHIFT + inset in the input mode. Next, let's talk about the basic knowledge of VIM clipboard. If you are interested, please take a look, it should be rewarding.
The clipboard-related content in the Vim Help document is as follows:

    1. Vim has 12 clipboard, which are 0, 1, 2,..., 9, A, ", +. You can use the: Reg command to view the content of each clipboard. In vim, simply copy Y to the "(double quotation marks) clipboard. Also, P is used to paste the content in the clipboard;

       

    2. To copy Vim content to a clipboard, You need to exit the editing mode. after entering the normal mode, select the content to be copied, and then press "NY" to complete the copy, n is the clipboard number (note that double quotation marks are followed by the clipboard number and then followed by Y). For example, to copy the content to clipboard a, select the content and press "ay, there are two points to note:
      • "No. Clipboard (temporary clipboard) is special. Press Y to copy it to the clipboard. Press P to paste the content in the clipboard;
      • + The No. Clipboard is a system clipboard. After you copy the content to the clipboard with "+ Y", you can use Ctrl + V to paste it into other documents (such as Firefox and gedit). Similarly, to copy the content copied by pressing CTRL + C or right-click elsewhere to VIM, press "+ P in normal mode;

       

    3. To paste the content in a clipboard of VIM, You need to exit the editing mode. In normal mode, press "NP, where N is the clipboard number, as described above, you can press "5 p to paste the content in the 5 th clipboard, or press" + P to paste the content in the global clipboard of the system.

Note: Here, only Vim. GTK or Vim. gnome can use the system global clipboard. The default Vim. Basic cannot see the + register.

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.