Vim Delete All Lines

There are multiple ways to delete all lines in VIM editor.

Following are couple of commands to remembered easily.

Open a file with vim and run one of the following command that will delete all the lines the file:

  1. :1,$d
  2. Type :gg or :1 to move the cursor to first line and then type :dG to delete all the lines.
By Sandeep Posted in vim

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s