Sometimes I need to replace .
with ->
when fixing code.
Usually search and replace cannot be used because there will be many (hundreds of) dots (.
) and only a few ones of them must be changed.
However, I find the ones that need to be changed when I am going through a make changelist.
Using the repetition operator does not quite work because if I change one instance and then repeat with the dot command, then I get this:
structBlah->.memberBlah
If I then use x to delete the extraneous dot, then paste and dot no longer work because the last change was a delete.
So, basically the problem is that the repetition operator repeats a motion and an edit, whereas here we need to repeat two edits: a delete and an insert.
Is there any convenient way to do this? One idea I had was to maybe use a macro like this:
xi-><ESC>
a<BS>-><Esc>
(likewisei<Del>-><Esc>
) commands are perfectly repeatable for me.s
instead ofi
to delete a character and go to insert mode.