Among the many useful keyboard shortcuts available in the bash shell, there is Ctrl–W to delete the word to the left of the cursor. Let's suppose my command line looks like the following:
cp some-file /foo/bar/baz/copy
Now I'd expect to be able to press Ctrl–W and end up with the following:
cp some-file /foo/bar/baz/
In Vim's command line it actually works this way: Only alphanumeric characters are treated as "word", whereas special characters (like
/) serve as delimiters marking the start of a new "word".
But unfortunately it doesn't work like that in all shells I've used so far. Only spaces will delimit a "word", so pressing the shortcut with the command line shown above will give me:
Is there a way to make Bash behave like Vim? Some configuration I can put into my