Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete word group in Vim

Tags:

vim

I am in vim editing a python file, how can you delete the sequence throw=it,? After searching online I see the command daw, but that doesn't work with this word group.

one two three throw=it, now
like image 469
appleLover Avatar asked Dec 10 '25 21:12

appleLover


2 Answers

another way is daW. with a capital W, it will delete any sequence of non-space characters, regardless of where inside the sequence you are.

This is different from dE, because dE only deletes from the cursor until the next end of the sequence of non-space characters, whereas daW will also delete the whole sequence between whitespaces.

like image 98
Benoit Avatar answered Dec 13 '25 14:12

Benoit


assuming cursor is at the start of throw=it, dE should do the trick

E           Forward to the end of WORD [count] |inclusive|.
            Does not stop in an empty line.
like image 24
tuxcanfly Avatar answered Dec 13 '25 14:12

tuxcanfly