How to delete a word in the INSERT mode
?
I'm usually using CTRL+W to delete from the cursor to the beginning of the previous word. Is there a shortcut to do the same but with opposite direction?
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.
Or, you could perhaps use the key sequence bdwi to delete the current word and go into INSERT mode. You can use bcw to go to the beginning of the current word then change the word, which leaves you insert mode. If your cursor is already on the first character of the word, that will end up deleting the previous word.
There's no built-in command for that but you can create your own easily:
inoremap <key> <C-o>de
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