-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implement dot-repeatability #7
Comments
thanks! I refrain from adding vim-repeat as dependency though, since I prefer to implement dot repeatability down the line without it. But I'll happily link to this info until then |
https://www.vikasraj.dev/blog/vim-dot-repeat This is a reference: you don't need vim-repeat to make it repeatable |
Thanks! I'll look into it |
Okay, so I looked into the linked guide as well as another guide I found and I am able to get simple examples with dot-repeatability going. However, both guides as well as the example from op implement dot-repeatability for normal-mode, whereas for this plugin, I'd need to add dot repeatability to an mapping for operating-pending-mode, for which dot repeatability apparently has to be implemented differently (the objects needs to be fully called again, not the operator, which is already dot-repeatable). Does someone here know any guides or plugins that explain how to make text objects dot-repeatable? |
I was thinking maybe https://github.com/nvim-treesitter/nvim-treesitter/blob/master/lua/nvim-treesitter/incremental_selection.lua can help. |
@chrisgrieser it's not a guide per se, but you might find the implementation of dot-repeat in my The challenge I think is that you have to decide whether dot-repeating repeats with the same value of the text object, or the same text object. For example, in my case, dot-repeating prints another debug line, with the value of the original text object from the first line printed (this is hard to explain, but try it). But you could presumably implement this such that it selects the text object again given the new cursor position. I don't know if there's a standard approach there. |
Thanks to the a great find by @vypxl and @ii14, the plugin now supports dot-repeatability. 🥳 While this is a non-breaking change, you do need to change your keymaps to get dot-repeatability. See the README. 🙂 |
Feature Requested
I think you could use something like my snippet, although it depends on
vim-repeat
. It's worth to use or at least suggest this way to bind.Relevant Screenshot
No response
Checklist
The text was updated successfully, but these errors were encountered: