Delete from cursor to end of line in `vi`
The command dw will delete from the current cursor position to the beginning of the next word character. The command d$ (note, that's a dollar sign, not an 'S') will delete from the current cursor position to the end of the current line. D is a synonym for d$.
Yeah I know of `dw`, but I guess I just assumed there would be a "delete the rest of this line" command. For example my line has `ip=|10.1.1.1` with `|` being the cursor location. Is there a command that will delete all the `10.1.1.1`?
@Falmarri - I apologize, I must have misunderstood your question. There is a command for that: `d$`
@Andy, the job is to delete from the cursor to the end of the line. If you consider deleting *more than that* to be "doing the job," you could also just use `:!rm -f %` and then `:q!`. That deletes the whole file.
@Amir Just use `d^` ('d' + caret)...basically d + any character that would normally move the cursor I think, but I am learning Vim myself, so I could be wrong on that.