VIm Question ...

C M Reinehr cmr at amsent.com
Thu Oct 18 06:36:33 PDT 2007


On Thursday 18 October 2007 07:06, James McDonald wrote:
> C M Reinehr wrote:
> > Ben,
> >
> > On Wednesday 17 October 2007 09:57, Ben Duncan wrote:
> >> I need to know the command to delete lines that DO NOT contain a string.
> >>
> > :v/works_4/d
> >
> > if you want to delete lines with works_4 appears anywhere in the line, or
> >
> > :v/^works_4/d
> >
> > If you want to delete lines only when works_4 only appears at the
> > beginning of the line.
>
> For me this deletes one occurance at a time? How do I make it global?

I don't have that problem here, but to address the entire document explicitly 
try either

:%v/works_4/d
or
:1,$v/works_4/d

Cheers!

cmr


-- 
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list