On Oct 22, 2009, at 6:59 PM, jean-christophe zulian wrote:
> Hi vimers,
>
> I have a problem for which I can't find the solution.
>
> Say I have the following text file:
> -8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---
> aaaa
> ....some text here
> delete
> ....some text here
> bbbb
>
> ....some text here
>
> aaaa
> ....some text here
> don't delete
> ....some text here
> bbbb
> -8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---
>
>
> What I want to do is to find every line starting with 'delete' and
> delete from the 'aaaa' line till the 'bbbb' line.
>
> The result of it should be:
> -8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---
>
> ....some text here
>
> aaaa
> ....some text here
> don't delete
> ....some text here
> bbbb
> -8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---
>
> I thought about using a global command to do that, but I can't get it
> working.
I would suggest something like:
:/aaaa/,/bbbb/g/^delete/d
See :help :range
Kind regards, Roald
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---