3 ms·
Q or @ to execute a macro over all visually selected lines is a feature I didn't know about but sounds amazing. All too often I create a macro that I want to e
by lawn 2y ago
Q or @ to execute a macro over all visually selected lines is a feature I didn't know about but sounds amazing.
All too often I create a macro that I want to execute many times, but it's hard to know how many. I've tried the guessing approach but that has a tendency to under- or overestimate.
- bitdivision 2y agoYou might find relative line numbers useful. `set relativenumber`
- lawn 2y agoI already use relative line numbers but they don't help when the lines continue below the window.
- kevincox 2y agoMy general approach for macros that I want to execute many times is to end by going down a line (for sequential lines) or to end with a search for the next place that the macro can run. Then I can easily review the targets and run or skip on each.
- linsomniac 2y agoI'll often visual select ("v" and motion) and then ":norm @a" to run the macro on all the selected lines.