How to make zsh meta-delete behave like bash? (To make it delete a word instead of the entire path.)

bashzsh

Bash's meta-delete will remove one path component instead of the entire path. How do you get zsh to behave like that?

I found this, which seems to work. Is this the right thing to do?

One of the things I most missed about bash when first switching to Zsh was that M-b and M-f (backward-word and forward-word) would jump over an entire /path/location, rather than to each word separated by a '/'. To make the behavior more like bash, you can evaluate this command:
export WORDCHARS=''

http://zshwiki.org/home/zle/bindkeys

Best Answer

This is duplicate with this question on SO.

One solution is to add the following to your .zshrc

autoload -U select-word-style
select-word-style bash
Related Question