Reputation: 181
In Vim is it possible to delete lines that has only one letter?
For example
This
is
an
x
z
example
c
would turn into
This
is
an
example
Upvotes: 0
Views: 337
Reputation: 94676
:g/^.$/d
:
— switch to the command line;
g
— run a global command over all lines;
/^.$/
— find a line that has exactly one character; beginning of the line, any character, end of the line;
d
— delete the line.
Upvotes: 4