vim clears all contents of the file

When using the vim editor, sometimes a file is edited, and the content of the file is relatively large. If you need to quickly clear the entire file, you can use the following command: In command mode, first execute gg Here is to jump to the first line of the file and then execute: dG This clears the entire file!

Another way is to quit VIM, and then use echo >> file, which can also quickly empty the file content.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325653792&siteId=291194637