Linux How-To

Methods to Delete all Textual content in a File Utilizing Vi/Vim Editor

SEOClerks

Vim is a superb software for enhancing textual content or configuration information in Linux. One of many lesser-known Vim tips is clearing or deleting all textual content or traces in a file. Though, this isn’t a often used operation, its an excellent apply to know or study it.

On this article, we are going to describe steps on delete, take away or clear all textual content in a file utilizing a Vim editor in numerous vim modes.

Learn Additionally: 5 Methods to Empty or Delete a Massive File Content material in Linux

The primary choice is to take away, clear or delete the all traces in a file within the regular mode (notice that Vim begins in “regular” mode by default). Instantly after opening a file, kind “gg” to maneuver the cursor to the primary line of the file, assuming it’s not already there. Then kind dG to delete all of the traces or textual content in it.

Delete Complete Text in Vi EditorDelete Complete Text in Vi Editor

Delete Full Textual content in Vi Editor

If Vim is in one other mode, for instance, insert mode, you may entry regular mode by urgent Esc or <C-[>.

Alternatively, you may also clear all traces or textual content in Vi/Vim in command mode by working the next command.

:1,$d

Delete Text in Vi EditorDelete Text in Vi Editor

Delete Textual content in Vi Editor

Final however not least, here’s a listing of Vim articles that you can find helpful:

10 Causes Why You Ought to Use Vi/Vim Textual content Editor in Linux
Be taught Helpful ‘Vi/Vim’ Editor Ideas and Methods to Improve Your Expertise
Methods to Allow Syntax Highlighting in Vi/Vim Editor
Methods to Password Defend a Vim File in Linux
6 Greatest Vi/Vim-Impressed Code Editors for Linux
PacVim – A Sport That Teaches You Vim Instructions

On this article, we’ve got defined clear or delete all traces or textual content in a file utilizing Vi/Vim editor. Keep in mind to share your ideas with us or ask questions utilizing the remark type under.

Share

Ask Anything

‘,
enableHover: false,
enableTracking: true,
buttons: ,
click on: perform(api, choices)
api.simulateClick();
api.openPopup(‘twitter’);

});
jQuery(‘#fb’).sharrre(
share:
fb: true
,
template: ‘

complete

‘,
enableHover: false,
enableTracking: true,
click on: perform(api, choices)
);
jQuery(‘#googleplus’).sharrre(
share: ,
template: ‘

complete

‘,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click on: perform(api, choices)
);
jQuery(‘#linkedin’).sharrre(
share: ,
template: ‘

complete

‘,
enableHover: false,
enableTracking: true,
buttons: ,
click on: perform(api, choices)
);
// Scrollable sharrre bar, contributed by Erik Frye. Superior!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().high + postEntry.outerHeight(),
topOfTemplate = header.offset().high;
getTopSpacing();
shareScroll = perform(){
if($window.width() > 719)
});

Source link

Related Articles

Back to top button