hotaru wrote:undoing the last action changes the file, but vim doesn't let you repeat that with ".". what's so special about pastes that you want to repeat them?
What's so special about inserts that you want to repeat them? Or anything else that you can repeat, for that matter? The answer is "nothing" - being repeatable is the default case, things don't need to be special to be repeatable... they need to be special to be
non-repeatable.
The right question to follow that statement is "what's so special about undo that you don't want to repeat it", which is a more interesting question.
For one, "undo" in and of itself is not a context-free command, and what it does varies wildly with context. Compare that with, say, inserts, which always let you type text and add it to the file (and can be sanely repeated by inserting the same text) or pastes, which always insert text from a buffer into the file (and can be sanely repeated by pasting the same buffer)... what should "repeating an undo" actually
do? There are a couple of options - it could undo to the next level, but that would have "." do wildly different things each time you press it... you expect that from "undo", by its nature, but "." you expect to do the same thing if you press it several times in a row. Or it could repeat the undone action - eg if you delete the word "cat", and then undo that deletion, "." could insert the word "cat". This seems particularly useless, and anyway, not all operations can be repeatedly undone like this... redo could be done in this way, but would still be useless.
For two, "undo" and "redo" are conceptually sort of meta-operations... you have your normal operations: insert, delete, copy, paste... with work directly with the file. Then a layer above that, conceptually, there's "." which repeats the last command. Then above that, there's undo and redo. It only really makes sense for "." to repeat the commands that are lower down than it on the layers of meta-commands.
But that's my reasoning. "." doesn't repeat undo or redo, and this makes sense, as it is valid as a special case. Paste is not a special case.
hotaru wrote:it's more common than repeating a paste.
Citation seriously needed. Or at least
some kind of reasoning behind it. Ditto on your claim that having "." repeat pastes is more confusing. A tip: Just claiming it again does
not count as "reasoning".