Vim: Can you delete a specific line number from another line?

The address of a colon-command (eg: the line number) comes first.

:89d

Note that this will also cause you to navigate to the location of the change. You can use `` to jump back.

If you’d prefer to have this be a single command you can define a custom command. eg:

command! -range -nargs=0 Delete <line1>,<line2>d|norm ``

This defines a command called Delete that deletes the addressed range (<line1>,<line2>d) and then navigates back (norm ``).

You can call it like:

:89Delete

You can actually invoke it with any unique prefix, so you may be able to get it down to:

:89D

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)