Blank line handling in VIM

Remove all real blank lines: :g/^$/d or :v/./d Remove all lines with only whitespace: :g/^\s*$/d (delete lines with regex match) Replacing multiple blank lines with one: :v/./.,/./-1j Replace multiple blank lines with one and delete single blank lines: :g/\n\n/j and then :v/./.,/./-1j Double space the file: :g/^/pu =\"\n\" or :g/^/pu... [more]