How do i insert a blank line before every comment (eg "#") in VIM?

Posted by vivekeviv on Stack Overflow See other posts from Stack Overflow or by vivekeviv
Published on 2010-04-20T07:04:15Z Indexed on 2010/04/20 7:13 UTC
Read the original article Hit count: 220

Filed under:

Hi In Gvim I need to insert a blank line or two before every comment in the file.

Eg

#comment 1
#comment 2
statement 1
statement 2
#comment 3

After running the comamnd it should be

#comment 1

#comment 2
statement 1
statement 2  

#comment 3

How do i do this?

Thanks

© Stack Overflow or respective owner

Related posts about vim