Pieter Op de Beeck schrieb:
> Hi All,
> 
>   I'm trying to delete empty lines on the condition that the previous
> line matches a certain pattern, like for example in the next input
> file:
> foo
> foo
> 
> foo
> 
> foo
> 
> bar
> 
> bar
> 
>   I would like to remove an empty line if the previous line matches
> 'foo'.

  :g/^foo\n$/+1d

removes every empty line after a line with a single foo.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to