by wolverine876 · 2y ago · 0 comments
? How? Does switching to normal mode create an undo/redo point? Someone asked me if the granularity of Vim's undo/redo could be increased (i.e., more frequent undo/redo points). In what they demonstrated, Vim's granularity seemed less than other applications (i.e., undo/redo acted on relatively large chunks of input); in some brief research, I didn't find a solution.
So when you press "o", I don't think "switch to insert mode". I think "insert a line with the following text:", which can then be undone with u, repeated with ., or whatever else you want.
At least that's my mental model of Vim, I don't know which is closer to reality.
Then again, if I am writing in Vim, I generally prefer the flow of actively editing what I wrote rather than undoing it.
This really applies to Vim as a whole: if you enjoy its UX, it's damn near perfection. If you hate it, you can leave. If you love it, but want it to behave just a little differently...then you can probably accomplish that with a plugin/configuration.
...but if you want to change Vim's UX more than a little, you're fucked. It feels totally possible until you realize it just isn't.
But, after getting used to vim’s commands, I find I go back to normal mode relatively quickly and so my undo steps are generally logical.
I suppose for some, "more granular" undo points could be useful, but I'm in such a habit of doing something discrete and then escaping insert mode, that I've never felt pinched by the potential for vim's large undos.