Is using macros' really common? I haven't yet figured out in when and where to use macros during my workflow.
Is using macros' really common? I haven't yet figured out in when and where to use macros during my workflow.
1. Do the same thing 3 times, realize that I'll be done faster if I automate it. 2. qz to record a macro into buffer z. 3. Do the work, taking care to leave myself in a state where the next invocation of the macro will pick up right where I want it to. 4. q to finish recording. 5. :map <M-f12> @z to execute buffer z 6. Hit Alt-f12 over and over until I'm done.
Seems like a lot of steps, but it has saved me tons of time.
Of course, as the other commenter said, some folks don't use the feature. That's ok. There's room for all kinds :)
Why map? @z and @@ till your are done? Or if you have this in your vimrc:
vnoremap @@ :normal! @@<CR>
@z, visual select, and @@.Or perhaps you're cleaning up a file, and there's a few common changes. Pop each into a macro and go to town. The low friction aspect makes them more common than the name might sound.
I have been wondering the same thing for some time. I always hear how great macros are, but haven't actually found a real world use case in my work.
But I figured it was because I didn't know something.
Everyone uses a slightly different subset of vim, in slightly different ways.
Don't worry about dogmas. Try everything out once, and keep what works for you!