I understand that the right way to delete until the end of line is d$, but why does dt$ not work also?
2 Answers
Because t
takes a character, so it looking for a literal $
character, not a motion like end of line
t
(and its variants T
, f
and F
) take a single character afterwards to denote the target of motion within the line.
So the effects of the two commands are:
d$
- delete to end of current linedt$
- delete up-to-but-not-including a literal $ on the current line
D
would also work, I think.:h operator
, and keep reading until you reach the end of the file, these are things you'll be using all the time.