How does :g/^$/,/./-j (reduce multiple blank lines to a single blank) work in vim?

Posted by Mert Nuhoglu on Stack Overflow See other posts from Stack Overflow or by Mert Nuhoglu
Published on 2010-06-13T11:18:53Z Indexed on 2010/06/13 11:22 UTC
Read the original article Hit count: 233

Filed under:
|
|

In the article, Vim Regular Expressions, Oleg Raisky gives the following command to reduce multiple blank lines to a single blank:

:g/^$/,/./-j

Can someone please describe how this works?

I know :g command and regular expressions. But I didn't understand what the part /,/./-j does.

© Stack Overflow or respective owner

Related posts about regex

Related posts about vim