Thursday, January 27, 2011

Delete blank lines in vim

Thanks to stackoverflow for this one.

:g/^$/d will delete all blank lines in a file

Why? Because :g will execute a command on lines which match the regex and :d deletes :)

No comments:

Post a Comment