Some simply ways to remove empty lines in a file:

# Use this sub:
:%s/^\n// 
# Or this:
:g/^$/d
# Or this:
:g/^\s*$/d