how to do a vim search inverse search for all lines with out text


matches all the lines were pattern is found.


does the opposite. See :h global for more details.

You can use it like this:

:v/pattern/norm Ipattern not found - <CR>

to prepend "pattern not found - " to every line that doesn't have "pattern" or


to replace "nrettap" with "pattern" on every line that doesn't have "pattern".

Contrived examples, yes.

To search for the lines not containing foo, for example, do: