Vi/Vim tips – Delete Lines
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
Leave a Reply
835 views, 1 so far
today |






