4 ms·
> :g/^\s*$/d I believe I've used a similar 'delete empty lines command' in the past, but it was just: :g/^$/d Can someone explain what the OP's regex is
by AdmiralAsshat 3y ago
> :g/^\s*$/d
I believe I've used a similar 'delete empty lines command' in the past, but it was just:
:g/^$/d
Can someone explain what the OP's regex is doing differently?
- wilkystyle 3y agoYour version deletes empty lines, but the version you quoted deletes lines that are blank or only have white space. Edit to be more helpful: ^ is the start of a line \s is a space character * means "zero or more of the previous character" $ is the end of a line
- AdmiralAsshat 3y agoGot it. He specifically said, "Remove all blank lines", so I assumed they were doing the same thing. I should've recognized \s as the space character.
- tzot 3y ago> I should've recognized \s as the space character. … whitespace pattern.
- deleted 3y ago[deleted]