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

Readline-like ^W behavior



Is it possible to make ^W delete the word to the left of the cursor
with the same word-boundary rules as in readline/bash?  Here's what
I'm looking for:

    bash$ ls foo-bar | wc^W
=>  bash$ ls foo-bar | ^W
=>  bash$ ls foo-bar ^W
=>  bash$ ls ^W
=>  bash$

I currently have ^W bound to "backward-kill-word" in zsh 4.1.1,
and it behaves like this:

    zsh% ls foo-bar | wc^W
=>  zsh% ls foo-bar | ^W
=>  zsh% ls ^W
=>  zsh%

As you can see from the above, the problem is that the second ^W
delets both the "|" and the word before it.  This is apparently how
the "werase" character works in canonical mode (Linux 2.4.x), though
I can't imagine why -- does it consider "|" a whitespace character?

I've also tried "vi-backward-kill-word", but it's too weak:

    zsh% ls foo-bar | wc^W
=>  zsh% ls foo-bar | ^W
=>  zsh% ls foo-bar ^W
=>  zsh% ls foo-^W
=>  zsh% ls foo^W
=>  zsh% ls ^W
=>  zsh%

Have I overlooked a function that corresponds to the readline
"unix-word-rubout" function?

-- 
 Haakon



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