Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete word after or around cursor in VIM

I'm now switching to VIM from TextMate. I found ^+W in INSERT mode very useful. However, I'd like to delete not only the word before cursor, but the word after or around cursor as well.

I did some googling, but the only thing I can find was ^+W to delete word BEFORE cursor.

like image 567
Mantas Avatar asked May 07 '09 10:05

Mantas


People also ask

How do I delete next word in Vim?

To delete a word, position the cursor at the beginning of the word and type dw . The word and the space it occupied are removed. To delete part of a word, position the cursor on the word to the right of the part to be saved. Type dw to delete the rest of the word.

How do I backspace a word in Vim?

If the mapping is always wanted, place the above in your vimrc.


1 Answers

Normal mode:

daw : delete the word under the cursor     caw : delete the word under the cursor and put you in insert mode  
like image 79
Amjith Avatar answered Sep 21 '22 05:09

Amjith