Skip to content
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

Support for . #96

Closed
bromanko opened this issue Jul 21, 2022 · 15 comments
Closed

Support for . #96

bromanko opened this issue Jul 21, 2022 · 15 comments

Comments

@bromanko
Copy link

I often use . to repeat a deletion. I know I should use number prefixes, but hey, I forget. Any chance this can be supported?

@godbout
Copy link
Owner

godbout commented Jul 22, 2022

this one is in the plans yes, but i kept postponing it because it's a big one. basically not all motions are repeatable, and in the case of Visual Mode moves you need to retain a lot of info like past selection length etc. so that's basically another min Vim engine to do.

but now that you're asking, i guess it's time to have a look at it. thanks!
i think i can start looking after kV29 is out (should be in a few days). but that will also have to be done gradually, like the count. each move has to be adapted. so: which ones would you need first?

@bromanko
Copy link
Author

That's totally fair. I find I use . most with delete commands. I might delete a word then decide I also want to delete one or two more.

@godbout
Copy link
Owner

godbout commented Jul 23, 2022

alright. i'll come back to you once i'm clearer about the repeat engine. my first idea is that once the engine is done, it should be quite straightforward to add moves in Normal Mode. but you never know. and there's maybe 50 delete motions 😅️ so they may not come altogether at the same time. anyways, more later.

@godbout
Copy link
Owner

godbout commented Oct 3, 2022

work on this is STARTING!

@godbout
Copy link
Owner

godbout commented Oct 4, 2022

@bromanko care to share how you use the .? which moves? do you use it to "paste back" the last typing you did? (didn't know that was a thing in Vim.)

@bromanko
Copy link
Author

bromanko commented Oct 5, 2022

Sure. I tend do do it for movements and deletes. Sometimes I’ll use it with ( to jump around. Or I’ll daw think a bit then want to do it again.

@godbout
Copy link
Owner

godbout commented Oct 5, 2022

Sometimes I’ll use it with ( to jump around.

sorry i don't get that one. . is supposed to repeat the last change. ( doesn't do any change on the text, just moves the cursor. am i missing something?

Or I’ll daw think a bit then want to do it again.

ok this one i get it 😅️

@bromanko
Copy link
Author

bromanko commented Oct 6, 2022

Ugh. Sorry. That first comment does make no sense. I'm not sure what I was thinking. I've been paying attention to my use of . this evening. I also tend to use it after a > command but I'm not sure that I've ever tried to do that with kindaVim. So looks like it's mostly my delete motions.

@godbout
Copy link
Owner

godbout commented Oct 6, 2022

that's good news. Part 1 should come with the >, and the deletion moves. the rest is a bit harder, as Vim is tracking changes even in Insert Mode, which i'm currently not doing. but if it's mostly for deleting and the >, they Part 1 should help already!

@godbout
Copy link
Owner

godbout commented Oct 14, 2022

@georgevreilly
Copy link

I came here to ask for . to work. I mostly use . with d but I definitely use it with c and other operators too to repeat the change.

@godbout
Copy link
Owner

godbout commented Oct 21, 2022

I came here to ask for . to work. I mostly use . with d but I definitely use it with c and other operators too to repeat the change.

i'll come back to you on that tomorrow. i'm going to create pinned issues/discussions for current topics. the . is one of them. there's many things to consider, questions to ask, etc. i'll clarify tomorrow. thanks.

@godbout
Copy link
Owner

godbout commented Oct 22, 2022

I came here to ask for . to work. I mostly use . with d but I definitely use it with c and other operators too to repeat the change.

so. i spent 1.5 years building the various kV Engines. basically, once everything was set, i just have to plug new motions that are requested by users. now the . is way more complicated. it requires another sort of engine. the d motions are ok to do because there's no difference between repeating the last change and the last motion. but for c, it's different. the issue is that i don't have control over what you do when in Insert Mode. you may delete text with the mouse. you may use a hotkey that runs Alfred and modifies text, etc. i'm not sure yet how to track those changes. the issue with Le Dot . and c is that Le Dot doesn't repeat the last motion but the COMPLETE CHANGE, including what happened in Insert Mode. Vim itself owns its own buffer, so it can track and do whatever it wants. but kV doesn't. so yeah, i'm not sure yet how to handle that. that's a big, long term one.

one way could be to make kV envelope everything. which means that when you'd be in Insert Mode (normal macOS), kV also takes over. and you wouldn't be able to delete for example with option delete anymore. that way i could record everything as a Vim motion, and reapply them when the . is run. but i don't think it's fine to completely change how macOS works.
haven't found another way that would work yet. even comparing before/after text doesn't work, because it's not about a number of characters difference for example, it is really about a motion. something like ciw has to be repeated, and in one case it may delete 5 characters but in another one 10. so yeah, big topic. still investigating. Le Dot is the current big piece for kV.

@godbout
Copy link
Owner

godbout commented Oct 22, 2022

pinned issue: #138

@godbout
Copy link
Owner

godbout commented Jul 25, 2023

closing as pinned issue for Le Dot now.

@godbout godbout closed this as completed Jul 25, 2023
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

No branches or pull requests

3 participants