DEV Community

Discussion on: What's your favorite Vim trick?

Collapse
 
jkreeftmeijer profile image
Jeff Kreeftmeijer •

Macros have been near the top of the list I’ve been planning to properly figure out for years now, I just never get around to it. I always have a hard time blindly recording macros with q<letter><commands>q.

I love the idea of writing macros in command mode, and having them available in the command history. That article looks great, too. Great suggestion!

Collapse
 
phallstrom profile image
Philip Hallstrom •

Brace yourself... you can still use your q...q command to record them as you go. Then, find a blank line somewhere and "qp and boom - your macro is right there. Tweak it, then highlight it and "qy and now @q will replay your new one.

Blew my mind when I figured out there was nothing special about qq.. it's just putting things into a buffer to replay.