I can yank a line to register a by "ayy.
But I am not able to figure out a way to yank some visually selected block to a particular register. If I just press y after selection, it stores it in the default register. But I need to store it in a specific register, how can this be achieved?
You can copy a block of text by pressing Ctrl-v (or Ctrl-q if you use Ctrl-v for paste), then moving the cursor to select, and pressing y to yank. Now you can move elsewhere and press p to paste the text after the cursor (or P to paste before).
One may overwrite a visual-block of text with another visual-block of text by: Select the first block: ctrl-v move "ay. Select the second block: ctrl-v move c ctrl-o "aP <Esc>
It's the same behaviour, but you tell the register after the visual selection.
An example:
You select some text in visual mode and copy it to register a:
V4j"ay
Go to end of file:
G
And paste it:
"ap
I can select a block using shift+v or vap (read: "visually select around paragraph") and then yank it using "ay. When I want to paste it again I use "ap or "aP.
Does this work for you?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With