Deleting a single line in Vim editor: To delete a line, follow the steps below: First, bring your cursor to the line you want to delete. Press the “Esc” key to change the mode. Now type, “:d”, and press “Enter” to delete the line or quickly press “dd”.
dG will delete from the current line to the end of file
dCtrl+End will delete from the cursor to the end of the file
But if this file is as large as you say, you may be better off reading the first few lines with head
rather than editing and saving the file.
head hugefile > firstlines
(If you are on Windows you can use the Win32 port of head
)
Go to the first line from which you would like to delete, and press the keys dG
:.,$d
This will delete all content from current line to end of the file. This is very useful when you're dealing with test vector generation or stripping.
I use the following steps to do the same-
Esc
.V
.G
i.e Shift + g
to select the text from the cursor to the end of the file .x
to delete the selected text .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