dt deletes till the next comma.
a, b, c[,] d, e
dt,
a, b, c[,] e
What is the command to perform same operation in backward direction in order to get:
a, b, d, e
d^ will delete from current backward to first non-white-space character. d0 will delete from current backward to beginning of line. dw deletes current to end of current word (including trailing space) db deletes current to beginning of current word.
Yes, use the "till" motion. means delete until a ". There is also the "find" motion, which deletes up to and including the character.
Its the fn key and backspace ( <X) ) or alt and backspace ( <X) ). I think what TK is getting at is a way to forward delete without breaking hand position on home row, in the same quick way you can backspace with Ctrl-H. It's an important capability for maintaining high editing speed and minimizing repetitive strain.
Often in Vim, the capitalised letter performs the motion in the opposite direction. Thus dT, will do the search backwards. However, you need to use 2dT, so that the first comma is deleted.
For the same reason you need to use df, instead of dt, to delete the comma in your given example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With