Delete All Blank Lines VIM g/^\s*$/d *:g* *:global* *E147* *E148* :[range]g[lobal]/{pattern}/[cmd] Execute the Ex command [cmd] (default ":p") on the lines within [range] where {pattern} matches. \s matches a space \s* matches a bunch of spaces or no spaces ^ matches the start of line $ matches the end of line d means delete the whole match g means do that everywhere