Vim: delete from cursor position to n characters before end of line

vim

In vim, with

dg_

you can delete the actual cursor position to end of line.
How can I delete the actual position to end of line minus some number of characters?

example:

this<cursor> is a ... many words ... line

How do I delete from <cursor> position to li of line word?

Best Answer

Say for 4 characters:

v$4hd
  • v - visual / select mode.
  • $ - go to end of line.
  • 4h - step back 4 chars.
  • d - delete selection.

Or you can just say skip the last word:

v$bhd

That will leave only the last word standing.