VIM: global match string, delete this and the next two lines

Here is what I mean:

% g/All Claims\t 0/3d

This does not work though (it appears to be an invalid syntax for multiplying the action in this mode). I ended up with the following sequence:

qq
/All Claims\t 0
3dd
q
10000@q

This macro worked out just fine. I'm just wondering if there is anything that would be appropriate and consistent with the first example. For further expansion, I'm looking for something that replaces 3d from the first line with a command that will do the same, or will refer to the macro accordingly.

+5
source share
2 answers

The command :gexpects an ex command, so you need to use :normallike this

:%g/All Claims\t 0/norm 3dd
+12
source

Another way to do this. for ranged

:%g/All Claims\t 0/.,+2d
+2
source

All Articles