- Make sure you are in the command mode in Vim by pressing the
Esckey. - You need to be at the beginning of the file. Press
ggfor that. This means pressing thegkey in quick succession. - Now press
dG. This means pressing the keydand then holdShiftand pressg. Yes,Gis 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.
Comments
Post a Comment