- Make sure you are in the command mode in Vim by pressing the
Esc
key. - You need to be at the beginning of the file. Press
gg
for that. This means pressing theg
key in quick succession. - Now press
dG
. This means pressing the keyd
and then holdShift
and pressg
. Yes,G
is uppercase and you'll have to use shift key here the same way you type G.
In short: Esc
+gg
+dG
is what you need to do for deleting all the lines of the file in Vim.
No comments:
Post a Comment