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:
- 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;"
- 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;
- 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)