Vim has the interesting property that insertions are actually transactions. Batches of typing can be repeated, undone, and generally messed with atomically. For example:
2iabc<esc> will enter insert mode, let you type abc, and when you leave insert mode, abc will appear a second time, having been entered twice.
Much more usefully:
iabc<esc><move around>. will enter insert mode, type abc, leave insert mode, move to a new location, and repeat the last insert at the new location. Great for things like strings in tests.
I poked around at adding this tonight. Up in vim-mode land it's actually not that complicated, but I ran into the weeds when I started to look at the telepath library SharedString underlying text buffers. It sure looks like these classes are just aching to support this kind of thing, what with their patches and transactions, but the transactions I see in the undo history are all associated with particular locations.
Is it possible to expose the concept of patches somehow? Something like 'apply the patch in undo location n to the current cursor location'?