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

Fwd: Strange behaviour in zsh's emacs bindings



Begin forwarded message:

From: Ludvig Ericson <ludvig@xxxxxxxxxxx>
Date: January 17, 2009 05:31:21 GMT+01:00
To: zsh-users@xxxxxxxxxx
Subject: Re: Strange behaviour in zsh's emacs bindings

On Jan 17, 2009, at 05:16, Benjamin R. Haskell wrote:

On Sat, 17 Jan 2009, Ludvig Ericson wrote:

On Jan 16, 2009, at 21:17, Benjamin R. Haskell wrote:

Putting a character in WORDCHARS tells Zsh to treat it as if it ispart of a normal "word". (i.e. that it *isn't* something that marks a word boundary.)


I very much doubt that. In my zsh, the untouched value is::

*?_-.[]~=/&;!#$%^(){}<>

I.e. pretty much the characters I expect to be word boundaries when I hit ^W.

"Some relevant sections from the manual" or "Far more than you ever wanted to know about WORDCHARS"

Glob Operators…
[...]  Matches any of the enclosed characters.…
       …named classes of characters, in the form ‘[:name:]’…
…
  [:WORD:] The character is treated as part of a word; this test is
           sensitive to the value of the WORDCHARS parameter
…
PARAMETERS USED BY THE SHELL…
WORDCHARS <S> [ed. '<S>' means it's "special"]
A list of non-alphanumeric characters considered part of a word by the
  line editor.
…
ZLE FUNCTIONS
 Widgets…
…
The word styles available are as follows. Only the first character
    is examined.

            bash   Word characters are alphanumeric characters only.

            normal As in normal shell operation:  word characters are
alphanumeric characters plus any characters present
                   in the string given by the parameter $WORDCHARS.

shell Words are complete shell command arguments, possibly
                   including complete quoted strings, or any tokens
                   special to the shell.

            whitespace
                   Words are any set of characters delimited by
                   whitespace.

            default
                   Restore the default settings; this is usually the
                   same as ‘normal’.



So, I suspect you're using something other than 'normal' word style.

e.g., in my Zsh:

## Let WORDCHARS contain '.' and '/' (your 'untouched value'):
$ echo WORDCHARS
*?_-.[]~=/&;!#$%^(){}<>
$ /this/is/a/very/long/path (Ctrl+W)
                         ^ <-- cursor
$
^
$ this is a.domain.name.example.com (Ctrl+W)
                                 ^
$
^

## So, take '.' and '/' out:
$ vared WORDCHARS
*?_-[]~=&;!#$%^(){}<>
$ /this/is/a/very/long/path (Ctrl+W)
                         ^
$ /this/is/a/very/long/
                     ^
$ this is a.domain.name.example.com (Ctrl+W)
                                 ^
$ this is a.domain.name.example.
                              ^

Personally, I take '/' and '=' out (not '.').

Best,
Ben

P.S. I composed this before realizing you'd replied off-list. Feel free to forward it to the list.


Sorry for my incompetence in using my own mail client.

At risk of hijacking this thread, I'm now puzzled. The behavior above simply doesn't occur for me.

I might add that I use vi keys, does that matter? I might also add that if I do dW in normal mode, it deletes ${WORDCHAR}s as well. But not using ^W.

- Ludvig

I guess today is simply not my best day with my mail client. The above are three messages that I think were supposed to be on the list.

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