Add something new to Virb:

Virb

Are you sure you want to delete that?

or Cancel

 

Posted on Jan 12, 2009

VI Tips of the Day #3

Deleting Text


After opening a VI session, often you'll want to delete "things" from your file:



  • CTRL+h or Backspace - Delete previous character

  • CTRL+w - Delete previous word

  • CTRL+x - Delete to start of inserted text

  • nx - Delete n characters beginning with current; omitting n deletes current character

  • nX - Delete previous n characters; omitting n deletes previous characters

  • ndw - Delete next n words beginning with current; omitting n deletes current word

  • ndb - Delete previous n words; omitting n deletes previous word

  • ndd - Delete n lines beginning with current; omitting n deletes current line

  • :n, md - Delete lines n through m

  • D or d$ - Delete from cursor to end of current line

  • dcursor_cmd - Delete text to cursor_cmd (e.g. dG deletes from current line to end of file)


Placed here for easy reference.

Loading comments...

Likes

Details

Viewed 1 time

© 2009 jleveille

virb.com/t/1027794
tweet!

Flag this text post!

Flag this text post as:

or Cancel

 

Advertisement

Flag this profile!

Flag this profile as:

or Cancel