Related to but not duplicate¹ of Bundling command sequences together for repeat (.).
The point (.
) command is really useful to redo the last action (insertion, replacement, etc.).
Sometimes I find myself making a small mistake that prevent me from repeating the action (because the mistake would be repeated). Is it possible to fix that mistake so that the fix is not considered to be the last action but instead added to the previous last action ?
For example, when editing the block:
triangles[0] = ...
triangles[1] = ...
triangles[2] = ...
To replace triangles by polygons without the :s command:
I go to the first t, then hit c
then type polygon (mistake: no s) then esc
. Then I realize my mistake: I have to go back to the p then change to polygons. Instead of doing that I would like to just press a key to amend the last action, then i
then s
. Finally I would use the .
key to repeat on the two last t.
¹ That question asks to repeat the last N commands/action instead of just the last one while I would like not to create a new command/action but modify the previous one.
\G
command, and look into how to edit the contents of registers before replaying them) However, doing so would in all real-world circumstances be more effort than just pressingu
and retyping yourc
command correctly.