Vim delete all lines in currently open file

April 30, 2013    vim

It's been a while since I blogged anything so I thought i'd stick this up which I found useful from time to time.

Deleting all lines in a currently open file when opening from vim in mac terminal.

Type gg to move the cursor to the first line of the file, if it is not already there.
Type dG to delete all the lines.

Then press "i" to insert new lines or copy from clipboard.

blog comments powered by Disqus