What command can I run to remove blank lines in Vim?
Nice. But not exactly a blank line.
innaM
2009-04-01 16:00:16
Ah, yes, this will match lines containing only whitespace characters. I'll accept soulmerge's answer.
nearly_lunchtime
2009-04-02 09:18:29
+19
A:
:g/^$/d
:g
will execute a command on lines which match a regex. The regex is 'blank line' and the command is :d
(delete)
soulmerge
2009-04-01 15:36:32
+1
A:
The following can be used to remove only multi blank lines (reduce them to a single blank line) and leaving single blank lines intact:
:g/^\_$\n\_^$/d
Draemon
2009-04-07 14:52:09