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'. I came up with:

:g/foo/+ s/^\s*\n//

  sadly, this doesn't delete the second empty line (at least on my
box: vim 7.1 - debian 5.0). Repeating the same command however ends up
deleting this second empty line as well.
  But I'm sure there is a 'right' way to do what I'm trying to achieve
here - your insights would be greatly appreciated.

Kind regards,
Pieter Op de Beeck.

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

Reply via email to