If I’ve been using Linux you have an "extra clipboard" called visual Selection, any selection with the mouse puts the selected content in it, to paste this content into the Insert mode do:
Ctrl-r *
Now if copying in the browser for example using Ctrl-c the content also goes to the default Clipboard, in Insert mode insert this content with:
Ctrl-r +
In normal mode you can insert these contents with:
"*p
"+p
To place these contents in the respective "Clipboards", select the desired section and do:
"*y
"+y
A common problem with newer vim users is when trying to copy a snippet to overwrite another, when deleting the target content it overwrites what was copied, but not the "zero" record, which contains the last snippet copied.
To paste what was copied over an excerpt that has just been deleted do: (in Insert Mode)
Ctrl-r 0
Finally you can copy from ourto vim file or even a different chunk of the same file to records ranging from 'a' to 'z' . Type, select a snippet and type "ay
, or delete a line by adding its content to the record a
, do:
"Add
When using a capital letter vim "adds" the contents to the record without overwriting it.
In global mode we can for example add all lines containing the word 'ERROR' to the record a
so that we can glue it in gold excerpt or archive of the vim:
:g/ERROR/normal! "Ayy
To ensure you must clear the contents of the 'a' record by doing
qaq
The theme can extend a lot because the vim records go beyond, I advise a calm deal on :h registers
. but follow some pearls:
Ctrl-r / .................. insere a última busca (Modo Insert)
Ctrl-r : .................. insere o último comando
Ctrl-r % .................. insere o nome do arquivo
:put a ................... insere o conteúdo do registro 'a'
Just one remark: the vim logs, and the Yank and Paste operations usually have no relation to the OS Clipboard. For integration see this link http://vim.wikia.com/wiki/Accessing_the_system_clipboard
– Bacco