How to Delete Blank Lines in Vim

Updated on

To delete all blank lines in a file using Vim (or nvim), you can do this:

:g/^\s*$/d

Read more here.

Feedback and Comments

What did you think about this article? Do you have any questions, or is there anything that could be improved? You can leave a comment after clicking on an icon below.

Tagged with Vim