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.

Tagged with: Programming Vim

Feedback and Comments

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