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

Re: WORDCHARS ignored for some reason?



On Sat, 13 Dec 2008, Sameer Siruguri wrote:

I have Zsh 4.3.4 on Cygwin, and one thing I haven't been able to figure out for the life of me, is why my word-based
commands in readline don't respect the word separators I have set in WORDCHARS.

/cygdrive/c/Users/sameer/Desktop>zsh --version
zsh 4.3.4 (i686-pc-cygwin)
/cygdrive/c/Users/sameer/Desktop>echo $WORDCHARS
*?_-.[]~=/&;!#$%^(){}<>
/cygdrive/c/Users/sameer/Desktop>

But when I do backward-delete-word, for example, it simply ignores most of those characters (the one I really care about
is forward-slash, because I want to delete folder path components).

I haven't found anything useful on multiple forums, so I finally decided to post this out there.

Thanks! Sameer.

By putting '/' in WORDCHARS, you're telling Zsh that those are characters that can be found in words. So, "abcd/efgh" is a single word. You want WORDCHARS to *not* include "/", since you want the words to be "abcd" and "efgh". (Words might be "abcd", "/", and "efgh", in that case -- not sure if non-word chars constitute words.)

Best,
Ben



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