kindaVim.docs icon indicating copy to clipboard operation
kindaVim.docs copied to clipboard

Support for `.`

Open bromanko opened this issue 3 years ago • 3 comments

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

bromanko avatar Jul 21 '22 21:07 bromanko

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?

godbout avatar Jul 22 '22 04:07 godbout

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.

bromanko avatar Jul 23 '22 05:07 bromanko

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 avatar Jul 23 '22 18:07 godbout

work on this is STARTING!

godbout avatar Oct 03 '22 06:10 godbout

@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.)

godbout avatar Oct 04 '22 05:10 godbout

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.

bromanko avatar Oct 05 '22 13:10 bromanko

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 😅️

godbout avatar Oct 05 '22 14:10 godbout

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.

bromanko avatar Oct 06 '22 00:10 bromanko

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 avatar Oct 06 '22 04:10 godbout

started in kV43: https://github.com/godbout/kindaVim.docs/releases/tag/43

godbout avatar Oct 14 '22 13:10 godbout

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.

georgevreilly avatar Oct 20 '22 21:10 georgevreilly

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 avatar Oct 21 '22 15:10 godbout

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 avatar Oct 22 '22 04:10 godbout

pinned issue: https://github.com/godbout/kindaVim.docs/issues/138

godbout avatar Oct 22 '22 05:10 godbout

closing as pinned issue for Le Dot now.

godbout avatar Jul 25 '23 18:07 godbout