Vim Macros are great for reducing repetitive keystrokes and speeding up your web development code editing processes.
By default the Vim Macro process is a little fiddly.
Using the Macrobiotics plug-in helps make the macro process a little easier.
Here we clean up a convoluted HTML document using some repeatable VM commands which makes the process of cleaning up the document a lot easier. Firstly we activate the macro recording using gq
and then we use our VM command of delete surrounding tags with the dst
keys now it’s time to end the recording so we can do this with gq
. Now because we want to repeat this command many times throughout this convoluted document we can simply repeat the last macro with the .
key.
Prerequisites
Vim Macrobotics plugin installed
more info
Basic Usage
Start Recording New Macro
End Recording Macro
Playback Last Recording
Playback Last Recording Multiple Times