-
Notifications
You must be signed in to change notification settings - Fork 30
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
[feature request] add highlight to the yanked region #121
Comments
@sergeichestakov should we add this feature, or should we limit the scope to vim defaults only? |
yeah I think we'll want to stick with defaults as close as possible. we can possibly add it as a config option tho |
I understand the importance to sticking with the defaults and avoiding scope creep, but if this can be added an an option, that would be amazing. Highlighting yanks is one of those quality-of-life features--I believe--that almost everyone adds to their configs right away. Thank you for considering this anyway! |
This is actually available as a default in Neovim, and it is super helpful. Especially for confirming the yanked region (especially when grabbing a paragraph or targeting a character where it is easy to overlook that there is another of the same character earlier or grab an extra whitespace), and also for teaching/presenting so that others can easily follow along what you are doing. I raised this in the jupyterlab-vim repo originally jupyterlab-contrib/jupyterlab-vim#117 and posted this example: |
Shameless plug here. I made an Obsidian plugin to do just that--highlight the yanked region. If you are using Obsidian and were missing that feature, check it out: https://github.com/aleksey-rowan/obsidian-vim-yank-highlight |
That's great, thank you @aleksey-rowan ! Is there anything from your approach that would be useful/able to be transferred over if this feature is approved to be added in codemirror directly? Or is it completely different to implement it in obsidian? |
@joelostblom, there is almost nothing Obsidian-specific apart from the plugin wrapper, so I think the same approach can be added to the codemirror-vim directly. It should be even easier since you can hook into the pushTest/yank handler instead of listening to key events and then trying to find yanked text in the viewport. There is another Obsidian yank plugin that does a similar thing by monkey-patching codemirror-vim, so their approach would be even more adaptable to be bundled in. |
Please add an option to highlight the yanked region like in https://github.com/machakann/vim-highlightedyank or natively in Neovim. Thanks!
The text was updated successfully, but these errors were encountered: