Very often I like to duplicate a block of code and comment out a copy.
For example,
for i in range(2, 20:
print(i)
# for i in range(2, 20:
# print(i)
for i in range(2, 20:
print(i)
Right now, I have to repeat a motion twice -- once to yank and once to comment out. And then of course I have to hit p to paste in the duplicate. It gets more complicated if I have to avoid clobbering my default register.
It would be nice to have this all rolled into one motion (that takes care of saving/restoring the registers).
Eg., gC" (or gyetc.) will behave just likegc`` but will paste a copy of the uncommented code next to the commented one.
Is it possible to support this?
Very often I like to duplicate a block of code and comment out a copy.
For example,
Right now, I have to repeat a motion twice -- once to yank and once to comment out. And then of course I have to hit
pto paste in the duplicate. It gets more complicated if I have to avoid clobbering my default register.It would be nice to have this all rolled into one motion (that takes care of saving/restoring the registers).
Eg.,
gC" (orgyetc.) will behave just likegc`` but will paste a copy of the uncommented code next to the commented one.Is it possible to support this?