The copy and paste summary of vim

Source: Internet
Author: User

Original address: Http://lsong17.spaces.live.com/blog/cns!556C21919D77FB59!603.entry

Content:

With vim so long, and always do not know how to use the system in vim in the Clipboard, usually to copy a piece of code on the Internet is the first gedit open file, the middle key paste close, and then use VIM to open the editor, really uncomfortable; Last forum someone asked how to use the system paste board in Vim, The impression of a lot of replies, there are several pages of the reply did not solve the problem, today really can not stand and find ways on the Internet, unexpectedly found, posted out to share.

If you just want to use the system pasteboard directly in the input mode by pressing Shift+inset, the following is the basic knowledge of VIM paste board, interested can see, should have some harvest.
The contents of the Vim Help document related to Pasteboard are as follows:

    1. Vim has 12 pasteboard, respectively 0, 1, 2 、...、 9, A, ", +; use: Reg command to view the contents of each pasteboard. In vim simply use y just copy to "(double quotation marks) in the Pasteboard, the same with P paste is also the content of this paste board;"

    2. To copy the contents of vim to a pasteboard, you need to exit edit mode, enter normal mode, select what you want to copy, and then press "NY to complete the copy, where n is the pasteboard number (note that you press the double quotation mark and press the pasteboard number to press Y), for example, to copy the content to pasteboard A, select the content and press Ay on it, there are two points to be explained:
      • "Number of paste plate (temporary pasteboard) is very special, directly press Y to copy to the Pasteboard, directly press p to paste the contents of this pasteboard;"
      • The + sign is the system pasteboard, with "+y content copied to the Pasteboard can use Ctrl + V paste it into other documents (such as Firefox, Gedit), in the same way, to the other place with Ctrl + C or right-click copy of the content copied to vim, you need to press" +p in normal mode;

    3. In order to paste the content of the vim in a pasteboard, you need to exit the editing mode, in normal mode, press "Np, where n is the pasteboard, as mentioned above, you can press" 5p paste the contents of the 5th number of pasted in, you can also press "+p paste the contents of the system in the global Clipboard.

Note: In my case, only VIM.GTK or vim.gnome can use the system global Pasteboard, the default vim.basic does not see the + sign register.

Vim Copy and paste summary (GO)

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.