How To Remove Empty Lines In Vi/vim

Some simply ways to remove empty lines in a file:

# Use this sub:
:%s/^\n// 
# Or this:
:g/^$/d
# Or this:
:g/^\s*$/d 
Posted in: How To, 2008-09-05 17:42:20
by Alexander V. Røyne-Helgesen
Tagged as: