Reputation: 1254
let's suppose I want to apply a macro stored on register 1 on lines: 2, 5, 9 but without applying on lines in between. I saw that you can give a range but that is not what I want. I've tried some variation on :2, 5, 9 @1 without success
Upvotes: 2
Views: 98
Reputation: 196466
If those lines have something in common, you can use the :global
and :normal
commands:
:g/foo/norm! @1
which is slightly "smarter" but probably a bit less intuitive than:
2G@1
5G@1
9G@1
See :help :global
and :help :normal
.
Upvotes: 1