How to select/delete until end of file in vim/gvim?

VGx

Enter Visual Mode, go to End of File, delete.

Alternatively, you can do:

Vggx

To delete from the current position to the beginning of the file.


d is delete and G moves to the end of the file, so dG will delete to the end of the file. It includes the entire current line though; if you're mid-line and want to preserve everything before the current position you need to use Mark's method


Yet another method: :.,$d

That means in ex mode, address current line to end, and delete.

Tags:

Vim