Is there a way how to delete a whole WORD (e.g. from vim path/to/some/file.txt
to vim
) in insert mode?
To delete a word in insert mode the C-W
shortcut works well. I got used to use C-W
in bash too but bash actually deletes whole WORDs.
Now I'd love to be able to delete whole WORDs in insert mode. How can I achieve this in vim?
There's only
:help i_CTRL-W
for words, and:help i_CTRL-U
for the entire line, but nothing for WORDs. You can easily define a custom mapping, though:Here's a more elaborate version, with better handling of corner cases: