-
Notifications
You must be signed in to change notification settings - Fork 16
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
Vim style bindings - is there a way to put numerical argument between verb and text-object?' #18
Comments
I don't think there's a way to do that with the normal Emacs keybinding scheme. It probably works in |
This indeed works in evil-mode, but I was hoping that this aspect would be possible to replicate somehow using ryo-modal as this is the only bit I find missing (although I'm sure I can either get used to it or work around it). |
I think I figured out a work-around using a hydra as that code has the universal arguments parts from from the emacs code integrated. This makes a hydra work as expected for things like d3w. Unfortunately doing this cleanly using a hydra for text-objects to be able to reuse it shows that the :then keyword added in response to #14 doesn't work as expected. The thing that goes wrong is that the command after :then gets executed immediately not when the hydra exits. Code that shows that the :then doesn't work as expected:
btw) obviously using :post in the defhydra itself would work to implement this, but having :then work as expected would lead to far less duplication. |
I don't think I can fix the issue with the hydras. Ryo would need to know that the command is a hydra command, and then somehow change the command based on the |
For clarity the timing is actually not with the :defhydra in contrast to what I thought when I wrote the above. But I guess you had spotted that already. In any case it is mainly surprising behavior if one takes the :then literally. btw) A hydra would end with "/body" in the function call, so it should be possible to detect it is a hydra call. Beyond that it is far from obvious and I doubt it is worth fixing. |
The current macro-example in the readme to get vim-like verbs and text-objects is very neat and makes it easy to get close to Vim-style editing. In particular as it also works with numerical arguments in front, so the following grammar works:
<number> <command> <text object or motion>
However when I use Vim I tend to remember operations that apply to multiple text-objects with the number after the command. Simply because "delete 3 words" makes more sense as a sentence than "3 delete words". So I tend to use the grammar as
<command> <number> <text object or motion>
Any thoughts on whether there would be a way that allows keybindings that has the numerical arguments in front of the text objects or motion?
The text was updated successfully, but these errors were encountered: