This has nothing to do with Vim, all editors behave that way (including emacs), they treat non-word characters as delimiters. Anyway, the behavior you are talking about is controlled by
readline and its manual lists quite a few commands you can assign shortcuts to. I am pasting a few relevant ones here but I recommend you read
man readline for more info:
Move back to the start of the current or previous word. Words
are composed of alphanumeric characters (letters and digits).
Kill the text from point to the end of the line.
Kill from point the end of the current word, or if between
words, to the end of the next word. Word boundaries are the
same as those used by forward-word.
Kill the word behind point. Word boundaries are the same as
those used by backward-word.
Kill the word behind point, using white space as a word bound‐
ary. The killed text is saved on the kill-ring.
Kill the word behind point, using white space and the slash
character as the word boundaries. The killed text is saved on
So, the one you want is
backward-kill-word, which uses non alphanumeric characters as word boundaries. By default, it is assigned to Alt+Backspace but you can change that by using either the global
/etc/inputrc if you want them to apply to all users or (better) your own local
As far as I can tell, Ctrl+W seems to be reserved and you can't use that one but you can choose another shortcut, Ctrl+J for example. Create a
$HOME/.inputrc file if it doesn't exist and add this line to it:
That should be enough for most modern terminal emulators. However, some older terminals use different codes. If you're using
xterm, for example, the line above should be written as: