Browse > Home / open source / Vi/Vim tips – Delete Lines

| Subcribe via RSS

Vi/Vim tips – Delete Lines

July 1st, 2009 Posted in open source

1.) Delete present line

Goto the line you want to start delete, press

Esc dd # Will delete present line

2.) Delete from line 1 to end of line.

:1,$ del # Delete from line 1 to EOL

3.) Delete from present line to end of line.

:.,$ del # Delete from present line to EOL

or

Goto the line you want to start delete, press

Esc d Shift g # Will delete all the lines from present line to EOL

. -> present line

1 -> line 1

$ -> End of Line

del -> Delete

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • FriendFeed
  • PDF
  • Reddit
  • Twitter
Tags:
blog comments powered by Disqus