[TriLUG] Negative search in Vi

Aaron Joyner aaron at joyner.ws
Fri Apr 11 22:22:19 EDT 2008


You can cheat, after a fashion, and sort of get this behavior.  You could
'narrow' the contents of the file with a command like this:
:g/<bad_pattern>/d

That will delete all lines in the file which matter your pattern, leaving
behind only those lines which do not, which you could then peruse at your
convenience.  It's the best I can come up with off the top of my head, vim
has a lot of features, so it's probably possible to do exactly what you
describe, somehow.   :)  On the flip side, my suggestio work in old-school
vi, too.

Aaron S. Joyner


On Fri, Apr 11, 2008 at 4:00 PM, Scott Lambdin <lopaki at gmail.com> wrote:

> Is there a way to search for the next line without a certain pattern?  I'm
> not figuring it out.
>
> --Scott
>
> --
> CILCIL
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>



More information about the TriLUG mailing list