Skip to content

Instantly share code, notes, and snippets.

@nirgeier
Last active March 22, 2024 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nirgeier/e374c065c71fc20537a20f8aa3070981 to your computer and use it in GitHub Desktop.
Save nirgeier/e374c065c71fc20537a20f8aa3070981 to your computer and use it in GitHub Desktop.
Vim Useful shortcuts

Vim Useful shortcuts

Delete all content of the file (empty file)

ESC + gg + dG

So, how does this dG command works?

  • gg - Jump to the first line of the file
  • dg - d is for the cut action and G is for moving the cursor to the end of the file.
  • This way, dG cuts all the text from the current cursor position to the end of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment