4 ms·
One thing I do all the time is making macros on the fly for repetitive edits with :map. E.g., switch the current and next line :map * ddp Then type * in comma
by 5teev 16y ago
One thing I do all the time is making macros on the fly for repetitive edits with :map. E.g., switch the current and next line
: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.
- crazydiamond 16y agoAre 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.
- 5teev 16y agoIt 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.)