dG VIM Command

How to use dG Command in Linux VIM editor?

Explanation


dG stands for delete from Current line to end of the file
This command is used to delete the content from current line to end of the file.

Usage:

dG

Example:

  • Open the file test.txt
    $ vim test.txt
  • We can notice the text in the file.
    Hiox India
    Vim Tutorial
    Line 1
    Line 2
    Line 3

  • Let us see how to delete the text from the third line to end of the file.
  • Move the cursor to the third line using the arrow keys
  • To delete the content from third line to end of the file
    Press dG
  • The content in the file after the delete operation
    dG Vim Command

Ask Questions

Ask Question