Delete n lines in vi editor

Repeat dd (delete current line) 100 times:
:100dd
Delete from current line to 99 lines forward
:d99j
Delete 100 lines backwards from (including) the current one
:d99k
Delete lines in a specific range by line number
:1,100d
Delete lines in a range beginning with the current line
:.,.+99d
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *