I have tried to follow the following:
How to delete selected text in VI editor
but
5dd
gives
E492: Not an editor command: 5dd
I then tried:
5d
Which only deletes a single line. How can I delete multiple lines?
I have tried to follow the following:
How to delete selected text in VI editor
but
5dd
gives
E492: Not an editor command: 5dd
I then tried:
5d
Which only deletes a single line. How can I delete multiple lines?
To delete all the lines use - ESC gg dG To delete few lines lets say 5 then use ESC 5dd
It could be done as following..
Sounds like you're entering the commands in command mode (aka. "Ex mode"). In that context
:5d
would remove line number 5, nothing else. For5dd
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:
.If you want to delete a range AFTER a specific line trigger you can use something like this
That deletes 11 lines (inclusive) after every encounter of
^TMPDIR
.Commands listed for use in normal mode (prefix with : for command mode).
Tested in Vim.
By line amount:
By line numbers:
Backwards range given, OK to swap (y/n)?
I find this easier
https://superuser.com/questions/170795/how-can-i-select-and-delete-lines-of-text-in-vi