Remove blank lines using Vim is very simple,


:g
will execute a command on each line that matches a regex
the regex “blank line” is ^$
the command is :d
so to remove all blank lines from a text file issue the following command:

:g/^$/d