I’m an Emacs newbie (using Doom Emacs with GNU Emacs 29.1). I came from vim, and battling with undo there was crazy enough, but I won using this:
inoremap u
inoremap u
inoremap u
inoremap u
inoremap u
inoremap u
inoremap u
inoremap , ,u
inoremap . .u
inoremap ( (u
inoremap [ [u
inoremap = =u
inoremap \" \"u
inoremap u
inoremap u
Also, I had autogroup that breaks undo every 4 seconds.
Basically, this configuration breaks undo on almost every possible type command, every Spacebar, Enter, comma, bracket, moving up, down, everything. This is because I hate when undo deletes the whole screen of text.
How do I replicate this in Emacs? I read this, but it doesn’t say what is considered a “recent change”.
This way of modal editing is fine when you write source code.
I write texts, articles. Most of the time I spend in Insert mode. And when I press
u
I see a wall of text disappeared.Maybe Vim let’s things go too far between undos.
I write a lot of text too, but I’ve never seen Emacs’s undo remove a whole wall of text that was typed by hand. If it was inserted from the kill-ring, sure.
Occasionally, it’ll undo a few more keystrokes than I’d prefer, but that’s rare. In that case, you can just undo the undo by pressing “C-g C-/”. And then remove only the text you wanted to get rid of.
By default Vim makes each foray into insert mode undo in a single step. So you have total control over how much gets undone each time: just exit and renter insert mode if you want more granular undo.