How do you delete all text above a certain line. For deletion below a line I use "d shift g"
Delete All Lines Press the Esc key to go to normal mode. Type %d and hit Enter to delete all the lines.
If you're at the end of a line and want to select the complete line, use the shortcut key combination Shift + Home . If there's only one line of text in the document, or you want to delete all text, press Ctrl + A key to select all text. Once highlighted, press delete to delete everything.
dgg
will delete everything from your current line to the top of the file.
d
is the deletion command, and gg
is a movement command that says go to the top of the file, so when used together, it means delete from my current position to the top of the file.
Also
dG
will delete all lines at or below the current one
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With