How can I delete multiple lines in vi?

后端 未结 11 1130
天命终不由人
天命终不由人 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:31

    Sounds like you're entering the commands in command mode (aka. "Ex mode"). In that context :5d would remove line number 5, nothing else. For 5dd to work as intended -- that is, remove five consequent lines starting at the cursor -- enter it in normal mode and don't prefix the commands with :.

提交回复
热议问题