I was just editing a file with vim and was about to do the same few strokes repeatedly. I vaguely remembered something about recording macros, so I tried it: I pressed q-1 to start recording, did my steps (a yank, a movement, an insert, a paste, a movement), and finished the recording with q. Now I could repeat these steps with @-1.
I then noticed that I forgot something at the end (moving the curser to the beginning of the line). I re-started recording (q-1), thought “hey, maybe I can insert the old recording here” and pressed @-1. Surprisingly, that worked. I added the missing movement and finshed the recording with q.
When I then tried to recall these commands with @-1, the editor froze and I was wondering whether the network connection went down (I was working over SSH). But it wasn’t, and it dawned me that vim did not insert my old commands when re-recording the macro, but just inserted the call to the macro itself. My text editor was caught in a infinite loop...
Not too bad, I just killed vim, did not lose anything and everything was fine. But I think an editor, even vim, should somehow prevent such behaviour.
Have something to say? You can post a comment by sending an e-Mail to me at <mail@joachim-breitner.de>, and I will include it here.