Developer's Lab

By Diogo Pinto - DiØ

Remove Blank Lines With Vi(m)

If you want delete blank lines using VI(M) editor, you can use the following match regex ^$ to perform it on the command mode option(Esc + Shift + :) . e.g:

:g/^$/d

The above mentioned entry, will specify the VI(M) editor, delete blank lines.

    g -> will execute command on all lines that match with regex.
    d -> command order, delete that line.

Comments