In the process of learning to use VIM, we know that in vim, the paste copy of the command is y/p, but we always encounter such a problem: How to paste the contents of vim inside the vim or copy of the content of the vim outside to paste into vim?
After many online access to information, and finally learned how to achieve this process
First, let's take a look at the concept: Vim Buffers and system Clipboard
Vim inside the paste copy is actually accessing data in the VIM buffer
And the system's Ctry+c ctry+v is the interaction with the system Clipboard
I do not know that I am not accurate description, anyway that is probably the meaning: Vim paste copy and system paste copy operation is not the same thing, so the system and vim is not so easy to use directly between
However, this problem can still be solved.
1. Open a file with vim and execute the command: REG to see if there is a + or x number or execute: Version command to see if there are +clipboard
If present:
You can use the +y to copy the contents of vim to the system Clipboard or +p the contents of the system Clipboard into vim.
If it does not exist:
You need to install Vim-gnome, then you can paste the copy with the above command
2. You can set the Clipboard=unnamedplus inside the/ETC/VIM/.VIMRC so that you can directly paste the copy using the y P command
How vim pastes replication with the outside world