re: What's your favorite Vim trick? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: My favorite so far is setting macros in command-line mode. This post basically blew my mind. I don't actually use macros that often and when I do ...
 

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!

 

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.

code of conduct - report abuse