Comments on: How to Delete all Text in a File Using Vi/Vim Editor https://www.tecmint.com/delete-all-text-in-a-file-using-vi-editor/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 15:26:47 +0000 hourly 1 By: Sergio Araujo https://www.tecmint.com/delete-all-text-in-a-file-using-vi-editor/comment-page-1/#comment-1187602 Sun, 30 Jun 2019 20:35:21 +0000 https://www.tecmint.com/?p=32363#comment-1187602 1,$ is equal to %, hence :%d does do job with less keystrokes.

]]>
By: Aaron Kili https://www.tecmint.com/delete-all-text-in-a-file-using-vi-editor/comment-page-1/#comment-1152471 Wed, 15 May 2019 04:22:09 +0000 https://www.tecmint.com/?p=32363#comment-1152471 In reply to jiaowen.

@Jiaowen

Many thanks for sharing.

]]>
By: jiaowen https://www.tecmint.com/delete-all-text-in-a-file-using-vi-editor/comment-page-1/#comment-1151218 Mon, 13 May 2019 11:00:21 +0000 https://www.tecmint.com/?p=32363#comment-1151218 In insert mode, you can type %d to clear the text.

]]>
By: Aaron Kili https://www.tecmint.com/delete-all-text-in-a-file-using-vi-editor/comment-page-1/#comment-1135010 Thu, 18 Apr 2019 18:41:16 +0000 https://www.tecmint.com/?p=32363#comment-1135010 In reply to dragonmouth.

@Dragonmouth

This article is intended to show users that Vim supports the explained option, especially after opening a file. Thanks for the feedback.

]]>
By: dragonmouth https://www.tecmint.com/delete-all-text-in-a-file-using-vi-editor/comment-page-1/#comment-1133951 Wed, 17 Apr 2019 11:31:24 +0000 https://www.tecmint.com/?p=32363#comment-1133951 Wouldn’t it be simpler to just delete and then recreate the file using the file manager?

I know that CLI is generally faster and more efficient than GUI but in this case you are just unnecessarily complicating things by using CLI.

]]>