-
Notifications
You must be signed in to change notification settings - Fork 7
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
Using as motion #7
Comments
Good point. I've created a new branch called def foo(one, two, three):
pass If the cursor is on def foo(one):
pass I figured looping would complicate things, both implementation-wise and conceptually. Could you try out the branch, see what bugs you can find? |
Sweet! Thanks, I'll give it a go soon! I was also thinking, how about mimicking how Implementing deleting in terms of a directional motion would then free up |
I think Regarding "nested" arguments, I'm not so sure. The example you gave could be deleted by jumping back to the |
Cool, if you get SidewaysJump working, you might want to remove the count-for-deleting-next arguments after that. Yep, moving to |
Didn't manage to work that weekend, other things came up. I put some time into it today and I think I'm going to have to do a little bit of refactoring to get this feature done in a nice way. I'll try to devote some time to it the upcoming weekend, let's hope I have more success this time :). Regarding the |
Cool. No hurry. Another idea I had about implementation is that could you reuse Vim's built-in (or syntax-based etc.) text-block-objects? I've recently found myself quite often trying to foo(1, 2, {
bar: 1337
}) I remember the argtextobj plugin I used used to behave like that. But it came with its own problems (which I don't remember. :P). |
I can't really imagine how this would be implemented generically and reliably. I'll take a look at the source code of argtextobj for ideas, but I don't think I'll be implementing multi-line argument lists. If nothing else, this particular example can easily be operated on with a More to the point, I've just pushed an implementation of counts that affect "outer" textobjects, the One thing that might be weird is that the "jump" motions should also wrap around the list, which may be surprising if you use a motion with a count that's too large. For instance, if you have 3 items to the right and you jump 5 times, you'll loop around from the other side. But I guess this is still okay, users simply need to mind the counts. I'm also starting to think it would make a lot of sense to create some default mappings right about now. Do you have any ideas for good ones? As I see it now, there are 5 motions:
|
I think I've gotten the motions working, though I'm not sure they're very useful the way they are now... The problem is that the motions go to the beginning of the arguments, not to the ends. Which makes a lot of sense if you're just jumping around, but not so much when you're performing a The built-in The only thing I can imagine is providing two sets of motions, a For now, could you exercise these motions, let me know what you think? I would also appreciate your thoughts on my previous question regarding default mappings. |
Did you get around to experimenting with the motions? What do you think about the |
Hey, Thanks for all the work on this! Sorry, haven't yet had the opportunity to delve head first into tweaking Vim again. I'll do so and then get back to you. :) |
No worries, just wanted to throw a bump in there, keep the issue alive :). |
Hey again, Yeah, I'm for for having Is the textobj with count branch still the one with the code you suggested I look at? Mind rebasing it ontop of your latest changes? :) Thank you! |
I've rebased the Do you have any thoughts on:
|
Thank you again! I'll check the branch out and then think it over about the start-end issue. ;-) You mean for automated testing? Add your default maps to your test's |
Is this going to make it into the main branch? I map SidewaysRight to a multi character key so typing it every time is annoying, and neither number repeats (e.g. "5") nor dot repeats (i.e. ".") work with this plugin. |
Hey,
Thanks for writing plugins with tests!
Any idea how to use Sideways's argument text objects as Vim motions? So instead of deleting or changing the argument you're on, you'd be able to say "delete the next two arguments"? I'm getting quite tired of counting commas manually and doing
d2f,
. :)The text was updated successfully, but these errors were encountered: