You could use:
:v/module/s/\v.*(sup|gnd).*//
:v/pattern/cmd runs cmd on the lines that do not match the pattern
\v turns on very-magic so that all the (, | characters are treated as regexp operator without the need to prefix them with \.
Note that it empties but otherwise doesn't remove the lines that contain sup or gnd. To remove them, since you can't nest g/v commands, you could use vim's negative look ahead regexp operator in one g command instead:
:g/\v^(.*module)@!.*(sup|gnd)/d
:g/pattern/cmd runs cmd on the lines the do match the pattern
(pattern)@! (with very-magic) matches with zero width if the pattern is not matched at that position, so ^(.*module)@! matches at the beginning of a line that doesn't contain module.
There's also the option of piping to sed or awk:
:%!sed -e /module/b -e /sup/d -e /gnd/d
/module/b branches off (and the line is printed) for lines that contain module.
- for the lines that don't, we carry on with the next two commands that delete the line if it contains
sup or gnd respectively.
or:
:%!awk '/sup|gnd/ && ! /module/'
If you wanted to find those files that need those lines removed and remove them, you'd probably want to skip vim and do the whole thing with text processing utilities. On a GNU system:
find . ! -name '*.back' -type f -size +3c -exec gawk '
/sup|gnd/ && ! /module/ {printf "%s\0", FILENAME; nextfile}' '{}' + |
xargs -r0 sed -i.back -e /module/b -e /sup/d -e /gnd/d
(here saving a backup of the original files as the-file.back, change -i.back to -i if you don't need the backup).
find finds the regular files whose name doesn't end in .back and whose size is at least 4 bytes (smaller ones can't possibly contain a line that contains sup or gnd (and the line delimiter)) and runs gawk with the paths of the corresponding files as arguments.
- when
gawk finds a line in any of those files that match, it prints the path of the file (FILENAME special variable) delimited with a NUL character (for xargs -0) and skips to the next file.
xargs -r0 processes that gawk outputs to run sed with those file paths as arguments.
sed edits the file in place.
I've list of line but I can't use/find suitable command after 2nd pipe How to process after pipe, because after second I've list line which has sup but exclude module line, but I am not able to delete to those line from the file...