How can I delete multiple lines in vi?

后端 未结 11 1133
天命终不由人
天命终不由人 2021-01-29 20:53

I have tried to follow the following:

How to delete selected text in VI editor

but

5dd

gives

E492: Not a

11条回答
  •  遥遥无期
    2021-01-29 21:23

    Press the Esc key to make sure your are not in an edit mode. Place the cursor on the first line to be deleted. Enter :5dd. The current line, and the next four lines should be deleted.

    Alternately, if you have line numbering turned on...

    Press the Esc key to make sure your are not in an edit mode. Enter :#,#d where '#' stands for the beginning and ending line numbers to be deleted.

提交回复
热议问题