< Browse > Home / Linux / Blog article: Vi/Vim tips – Delete Lines

| RSS

Vi/Vim tips – Delete Lines

July 1st, 2009 | No Comments | Posted in Linux

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

Related Posts
  • No Related Posts
Leave a Reply 835 views, 1 so far today |
Tags:
Related Posts
  • No Related Posts