How to insert multiple lines in Vim?

QUESTION:
I delete / copy every other row with :g/^/+d However, when I try to insert all these rows, only the last row will be inserted. How to paste every single line that I deleted / copied?

RESOLVED :
Thank you all! With your help, I was able to finish my video (I am working on a Youtube channel called Vim Girl, where I manage Vim Golf problems.) Here is a link if you are interested: https://youtu.be/S9o5bHUAbP0

+4
source share
3 answers

. , :let @a='' qaq. .

:g/^/+d A

"a. "ap.

, , :

:let @a=''
:g/^/+d A
:$pu a

: :g/^/+m$

.:

:h :let-@
:h :d
:h quote_alpha
+7

, , ^shiftc, .

, , ESC:set paste insert, ^shiftv

/, dd p . d4d dd / 4 .

+2

, :

qdddGp<ctrl + o>jq

then run it as many times (20, for example) as you need:

20@d
+2
source

Source: https://habr.com/ru/post/1680829/


All Articles