dgg VIM Command

How to use dgg Command in Linux VIM editor?

Explanation


dgg stands for delete from first line to Current line
This command is used to delete the content from first line to current line in the file.

Usage:

dgg

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 first line to third line.
  • Move the cursor to the third line using the arrow keys
  • To delete the content from first line to third line
    Press dgg
  • The content in the file after the delete operation
    dgg Vim Command

Ask Questions

Ask Question