Re:A Starting Guide to VIM from Textmate
by crazydiamond on Friday November 19, 2010 @11:17PM
(#1923835)
Are you not aware that '*' (asterisk) searches for the next occurrence of the word under the cursor. That's one key i just can't live without. '#' (hash) does the reverse.
Why not do a 'qq' to record your macro as 'q' and @q to replay it.
It was an arbitrary choice for an example. Obviously one would choose a key not being used for anything else. (This choice can also vary from session to session, depending on the task at hand.)
:map * ddp
Then type * in command mode to execute the steps.
And if you mangle your file beyond hope with out of control macros, there's always u to undo and :q! to quit without saving.