Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to duplicate + comment #84

Closed
jeetsukumaran opened this issue Dec 5, 2021 · 3 comments
Closed

Option to duplicate + comment #84

jeetsukumaran opened this issue Dec 5, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@jeetsukumaran
Copy link

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?

@gegoune
Copy link

gegoune commented Dec 5, 2021

Duplicate #70.

@numToStr numToStr added the duplicate This issue or pull request already exists label Dec 6, 2021
@numToStr
Copy link
Owner

numToStr commented Dec 6, 2021

@jeetsukumaran This was already requested earlier. You should also follow #73 where I gave an example of how to achieve this :)

@numToStr numToStr closed this as completed Dec 6, 2021
@jeetsukumaran
Copy link
Author

Thanks! Will do. And thanks for this plugin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants