I know I can yy
on line 1 and then visual select lines 4 and 5 2p
(Vim copy one line and paste it to multiple lines).
1 COPY THIS
2
3
4 HERE
5 HERE
So I get:
1 COPY THIS
2
3
4 COPY THIS
5 COPY THIS
But instead, let's say I would like just COPY. If I visual block select COPY and then 2p
on lines 4 and 5 visual selected
1 COPY THIS
2
3
4 COPYCOPY
5
How do I paste 1x at each line? Like:
1 COPY THIS
2
3
4 COPY
5 COPY
You can modify the register
"
(unnamed) to contain a newline, but at this point its most likely easier to create a new line, paste your content in it anddd
it again.For further ideas see also this thread.