Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Modify Zsh Configuration to Make M-backspace Remove Last Path Component



Hi Phil,

that sounds nice, too!

Thanks,
Markus


Am Sat, 11 Feb 2017 21:49:09 +0000
schrieb Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>:

> On 2017-02-11 at 17:01 +0100, Julien Jehannet wrote:
> > You can change the WORDCHARS setting by removing slash character:
> > 
> > WORDCHARS=${WORDCHARS:s@/@}
> 
> In addition to this, I find that I like ^W to keep the normal
> behaviour, but M-backspace to be different, so I do this:
> 
>     function backward-kill-partial-word {
>         local WORDCHARS="${WORDCHARS//[\/.]/}"
>         zle backward-kill-word "$@"
>     }
>     zle -N backward-kill-partial-word
>     for x in '^Xw' '^[^?' '^[^H'; do
>         bindkey "$x" backward-kill-partial-word
>     done; unset x
> 
> -Phil



Messages sorted by: Reverse Date, Date, Thread, Author