If you have been using Linux you have an "additional clipboard" called visual selection, any selection with the mouse places the selected content in it, to paste this content in insert mode do
Ctrl-r *
Now if you copy 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 enter these contents with:
"*p
"+p
To paste these contents into the respective "Transfer areas", select the desired section and do:
"*y
"+y
A common problem for novice vim users is when you try to copy one excerpt to overwrite another, by deleting the destination content it overwrites what has been copied but not the 0 "zero" record, which contains the last excerpt copied.
To paste what was copied over a passage that has just been deleted do: (in Insert Mode)
Ctrl-r 0
Finally you can copy from ourto vim file or even a different snippet from the same file to records ranging from 'a' to 'z'. Type, select an excerpt and type "ay
, or delete a line by adding its contents to the a
register, do:
"Add
When using a capital letter, vim "adds" the content to the record without overwriting it.
In global mode we can for example add all rows containing the word 'ERROR' to the a
registry so that we can paste it into gold snippet or vim file:
:g/ERROR/normal! "Ayy
To ensure you must clean the contents of the 'a' record by doing
qaq
The theme can be extended a lot because the vim records go further, I advise one to deal calmly with :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'