Monday, 13 October 2014

How can I delete all lines in Vim?

To delete all lines in a file with vim you can type:
in command mode. Semicolon(:) indicates a command, 1,$ indicates a range that following command will work. In that case from 1st line to the last line. d means delete the specified lines.

Another command for the same purpose is:
gg takes you to first line and d means delete again and G means to the last line.

And one more command is:

No comments:

Post a Comment