Replies: 14 comments 1 reply
-
I agree what you say. |
Beta Was this translation helpful? Give feedback.
-
See #1142 |
Beta Was this translation helpful? Give feedback.
-
This issue should probably be closed as a duplicate. |
Beta Was this translation helpful? Give feedback.
-
The time based undo in the other issue is a rather new approach and is a bit unpredictable and also potentially fits too much text (when you type without interruptions) into a single undo vs the usual text units-based undo proposed here, so not really a duplicate |
Beta Was this translation helpful? Give feedback.
-
Oh, true. |
Beta Was this translation helpful? Give feedback.
-
What about implementing save-based undo? Like vim |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It's a good command that's worth implementing (and I like it better than undos based on time as I can have a better mental model of saving after some logical chunk of work rather than trying to guess how much time that chunk of work took), but it operates on a different "time frame": it's suitable to undo big chunks of edits you've committed to a file, but unsuitable for smaller changes of the last few words/sentences/edits. |
Beta Was this translation helpful? Give feedback.
-
and a text editor isn't git, so not sure how that's relevant, we'd better use text editing experience from other apps for comparison. |
Beta Was this translation helpful? Give feedback.
-
We do. Helix has roots from Vim and Kakoune which have matching behavior. Having to press
That's sort of the point though, You can delete back by one word via
|
Beta Was this translation helpful? Give feedback.
-
But you don't need to do that! I'm not proposing you to remove all the other undo operations, so we can continue to press a single button to undo a whole chunk of text (e.g., execute an imaginary
So do I, until I don't and type whole sentences/paragraphs without any edits (sometimes even leaving fixing typos for later to avoid interrupting the flow). What's the value of being able to wipe out the changes only by sentences/paragraphs of text or having to break the flow to add undo points manually?
The modality is the point of this model, and it brings with it a host of benefits like the ability to bind a command to a single key without modifiers (and play vim golf outside of hx if the weather is nice ;)) etc. Having to manually manage undo points within long editing sessions doesn't follow from that.
But this is a bad suggestion precisely for the anti-feature reason you described above — that just floods your undo history on a per char basis. I don't need that kind of granularity :) Then you could also combine it with adding undo breaks on punctuation:
And on spaces like you suggest, then I think that should fully resolve this feature request
Is this an existing command or a planned one? Tried to use it, but it errored out on launch, would also be great for some other things I wanted to do P.S.
Just out of curiosity, how would this command differ from a |
Beta Was this translation helpful? Give feedback.
-
For anyone coming here from google, a
Maybe also to |
Beta Was this translation helpful? Give feedback.
-
I think @archseer made his stance clear here and I agree.
|
Beta Was this translation helpful? Give feedback.
-
Is there a way to set this up currently? The above example works with newlines but how about spaces? This won't insert a space
|
Beta Was this translation helpful? Give feedback.
-
Currently
undo
seems to undo all the changes per an "Insert session"So, this
insert_mode
type a lot of text
normal_mode
undo
deletes "type a lot of text"
This is too coarse, especially when typing a lot of text in one go.
Is there a way to increase the undo granularity to delete, say, by typed word? So it would behave more like this:
1st
undo
deletes "text"2nd
undo
deletes "of "3rd
undo
deletes "lot "...
(can be a separate command or an additional argument like
:undo 1w
or something)Beta Was this translation helpful? Give feedback.
All reactions