Wednesday, July 18, 2012

Re: How to remove empty lines except of one

On Wed, Jul 18, 2012 at 04:35:56PM EDT, Bee wrote:

> %s-\_s\+\n-\r
>
> Removes ALL blank lines,
> rather than collapsing multiple blank lines into one 'blank' line.
>
> I still want one blank line between 'paragraphs'.

So maybe the not-so-elegant but yet correct answer is..

| :%s/^\_s\+\n/\r
| :%s-\_s\+$-\r

CJ

--
ALL YOUR BASE ARE BELONG TO US!


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment