Remove all blank lines using Vim

Remove blank lines using Vim is very simple,

will execute a command on each line that matches a regex
the regex “blank line” is ^$
the command is :d
so to remove all blank lines from a text file issue the following command:

Related Posts

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.