The undo command feels a bit random. Sometimes it undoes massive chunks, sometimes tiny changes. How is the cut-off point determined?
It undo the last command (e.g.
The insert (
i) command can indeed be either rather large if you type a long text without leaving the insert mode or rather short if you just make a small change and leave the insert mode.
In insert mode you you can type Ctrlgu to split the insert operation and create shorter undo chunk.
Somes add the following mapping in their
.vimrc file to make sure every words inserted in insert mode are in their own undo chunk.
:inoremap <space> <C-g>u<space>