How to Delete Blank Lines in Vim
Vim is a powerful tool. I often paste raw data into Vim in order to format it in a specific way, and sometimes I need to clean up the file by removing many blank lines. Fortunately there is a simple Vim command to remove all blank lines in a file.
tl;dr
:g/^$/d
See below for more details.
Posted in these interests: