Arguably what makes Vim the greatest tool for web development is the breadth of its customisation:  It's like having an exo-suit for development - used correctly it does most of the heavy lifting.

Macros are the articulations that make code "lifting" a breeze.  If you don't know what Macros are, they allow you to "record" a series of actions and re-perform those with a keystroke. Imagine being able to "record" going to the gym - then, instead of going again the next day you simple hit a key and it is done - with all the benefits, and without a second wasted.  Isn't that power?

So, how do we Macro.  It's very simple. Once in Vim, press q and then a letter (a register).  This assigns what you are about to record into that key (register).  You can then recall the macro stored in that key.

Here is an example, enter:

q + c

You should now see "recording" appear in the Vim command line (bottom left).  Now, whatever you do is recorded into "c", and can be recalled at any time. A simple and useful macro might be a comment, so type in /* */ and move your cursor back into the center (ready to enter a comment).

Press 'q' again to stop recording.

Now you have a comment Macro.  To access Macros we use the @ symbol.

Press @c and you will see the action you performed called again.  A new comment, and the cursor is right where you need it to be.  How cool is that?

Clearly this is a banal example of the power of Macros.  And such a simple example might be best used in a "register" instead (more on that later).

Practice with macros:  Write a word and record a macro that will "wrap" the word with an A link.  Try more complicated macros and soon an veritable coding exo-suit will be your very own.

No need to thank me.