Skip to content

[Feature request] ability to specify register when yanking #543

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

Open
jacktose opened this issue Apr 29, 2025 · 2 comments · May be fixed by #544
Open

[Feature request] ability to specify register when yanking #543

jacktose opened this issue Apr 29, 2025 · 2 comments · May be fixed by #544

Comments

@jacktose
Copy link

NERDCommenterYank yanks to the default unnamed register "". Like all other yanking/pasting in vim, this is a good default, but it's also nice to be able to choose a register. One use case is creating a “comment and duplicate” function/mapping without clobbering the default register, as discussed in #435.

I don't know the internals or the right syntax, but from a UX perspective, I would hope for all of the following:

  • ["x][count]<leader>cy - Support standard register specification for NERDCommenterYank mapping, as with ["x]yy and friends.
  • ["x]<plug>NERDCommenterYank, <plug>NERDCommenterYank({register}), or similar way to specify a register when invoking this way (e.g. in a user-defined function or mapping).
  • NERDComment({mode}, {type}, [{register}]) - Specify register when type=Yank.
  • let g:NerdYankRegister = x - Set default register used by NERDCommenterYank.
@alerque
Copy link
Member

alerque commented Apr 30, 2025

Contributions welcome. This doesn't really have an active maintainer right now but I'm trying to keep up with facilitating PRs when they come along.

@jacktose jacktose linked a pull request May 6, 2025 that will close this issue
@jacktose
Copy link
Author

jacktose commented May 6, 2025

Well, that was a learning opportunity! Opened #544 and would appreciate your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants