What command can I run to remove blank lines in Vim?

14 s
14

:g/^$/d

:g will execute a command on lines which match a regex. The regex is ‘blank line’ and the command is :d (delete)

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *