Let vim support the system Clipboard

Source: Internet
Author: User
Tags opera mail

1. Write original articles in Vim, or reprint the classic articles you see;
2. After writing in Vim, arrange the version, then, the shortcut key operation: GG, SHIFT+V, SHIFT + G,
"+y, explain:" +y is to copy the selection into the system clipboard
3. Ctrl + M Open Opera mail, paste it;
4. Write a good theme, send directly to my blog related mailbox;

OK, an article has been completed.

All cut, copy, and paste operations are performed between the VIM register + and the system Clipboard. Vim's Register + is associated with the system Clipboard, i.e.:
"+y Copy to system Clipboard
"+p paste the contents of the system Clipboard into vim


Whether it is vim internal or external copy ([Y]ank), delete ([D]elete), paste ([P]ut), in Vim are all with the help of registers (register), vim a total of 9 types of registers:
Nameless (unnamed) Register: "", cache the last action content;
Digital (numbered) Register: "0-" 9, cache the most recent operation content, copy and delete is different;
Inline Delete (small delete) Register: "-, cache in line delete content;
Named (named) Register: "A-" Z or "A-" Z, available when specified;
Read-only (read-only) registers: ":,"., "%," #, respectively, cache the most recent command, the most recently inserted text, the current file name, and the current alternate file name;
Expression Register: "=, read-only, used to execute an expression command;
Select and drag (selection and drop) registers: "*," +, "~, Access GUI Select text, can be used to interact with external applications, using the prerequisite for the system Clipboard (clipboard) available;
Black Hole Register: "_, do not cache the contents of the operation (clean delete);
Mode register (last search pattern): "/, caches the most recent search mode.

The above description is a brief overview and is not entirely accurate, as detailed instructions must refer to the manual: 1:help copy-move


The register that is available under VI or VIM without a graphical interface includes only {a-za-z0-9.%#:-}, which obviously does not contain the above mentioned "* or" + options and drag-and-drop registers.

Thus, the key to realize the mutual copying and pasting of vim and external applications is whether the system Clipboard is available for VIM. To see if the Vim Clipboard is available in the command for Vim--version,

For non-GUI versions of Vim, the Clipboard is not available, the solution is simple, install it:

sudo apt-get install Gvim


Ubuntu and mint default installation of Vim is not supported by the system cut, paste version, you need to perform the following installation:
sudo apt-get install Vim-gnome

Let vim support the system Clipboard

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.