zsh-users
 help / color / mirror / code / Atom feed
* Definition of a word
@ 1998-12-01 22:52 Ollivier Robert
  1998-12-02  0:11 ` Phil Pennock
  1998-12-02  0:56 ` Jan Kroken
  0 siblings, 2 replies; 5+ messages in thread
From: Ollivier Robert @ 1998-12-01 22:52 UTC (permalink / raw)
  To: zsh-users

Is there a way to refine what zsh think of as a "word" ? It seems that a
word is "anything other than whitespace" which gets really annoying when
one use <ESC><BS> to delete part of a path because the whole path is
destroyed :-(

<ESC><BS> is "backward-delete-word" in tcsh and "backward-kill-word" in zsh
BUT their notion of "word" is different.

Example:                                                                      

tcsh> ls -l /usr/local/bin                                                  
<ESC><BS>
tcsh> ls -l /usr/local/                                                       
<ESC><BS>
tcsh> ls -l /usr/                                                             

while in zsh, I get this... ("/" is not a word delimiter).

zsh> ls -l /usr/local/bin                                                     
<ESC><BS>
zsh> ls -l                                                                   

Last time I checked, bash 2.x was behaving like tcsh.
-- 
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
Usenet Canal Historique


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Definition of a word
  1998-12-01 22:52 Definition of a word Ollivier Robert
@ 1998-12-02  0:11 ` Phil Pennock
  1998-12-02  0:56 ` Jan Kroken
  1 sibling, 0 replies; 5+ messages in thread
From: Phil Pennock @ 1998-12-02  0:11 UTC (permalink / raw)
  To: Ollivier Robert, zsh-users

Typing away merrily, Ollivier Robert produced the immortal words:
> Is there a way to refine what zsh think of as a "word" ? It seems that a
> word is "anything other than whitespace" which gets really annoying when
> one use <ESC><BS> to delete part of a path because the whole path is
> destroyed :-(

Change the WORDCHARS variable, documented in zshparam(1).
 WORDCHARS <S>
   A list of non-alphanumeric characters considered part of a word by
   the line editor.

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

Change this in your .zshrc to the equivalent, without the '/' in there.

Perhaps the 'emulate' command should also change WORDCHARS accordingly?
-- 
--> Phil Pennock ; GAT d- s+:+ a22 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++
E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+
G+ e+ h* r y?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Definition of a word
  1998-12-01 22:52 Definition of a word Ollivier Robert
  1998-12-02  0:11 ` Phil Pennock
@ 1998-12-02  0:56 ` Jan Kroken
  1998-12-02  7:57   ` Thomas Köhler
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Kroken @ 1998-12-02  0:56 UTC (permalink / raw)
  To: Ollivier Robert; +Cc: zsh-users


Ollivier Robert <roberto@keltia.freenix.fr> writes:

> Is there a way to refine what zsh think of as a "word" ?

Variable index:

`WORDCHARS'
	A list of non-alphanumeric characters considered part of a word by
	the line editor.

info is your friend :)
-- 
                                                     -jk


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Definition of a word
  1998-12-02  0:56 ` Jan Kroken
@ 1998-12-02  7:57   ` Thomas Köhler
  1998-12-02  8:44     ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Köhler @ 1998-12-02  7:57 UTC (permalink / raw)
  To: zsh-users

Hello,

Jan Kroken <jankr@ifi.uio.no> wrote:

> Ollivier Robert <roberto@keltia.freenix.fr> writes:
> 
> > Is there a way to refine what zsh think of as a "word" ?
> 
> Variable index:
> 
> `WORDCHARS'
> 	A list of non-alphanumeric characters considered part of a word by
> 	the line editor.
> 
> info is your friend :)

*uhm*
picard ~> bindkey -v
picard ~> cd /usr/local/bin_
(hit ^W)
picard ~> cd /usr/local/_
(hit ^W)
picard ~> cd /usr/local_
(hit ^W)
picard ~> cd /usr/_

Why isn't WORDCHARS honored when in vi-like editing mode?

CU,
Thomas [still using zsh-3.1.4]

-- 
    Thomas Köhler    Email:     jean-luc@picard.franken.de
        <><           WWW:    http://home.pages.de/~jeanluc/
                      IRC:               jeanluc
      LCARS --- Linux for Computers on All Real Starships


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Definition of a word
  1998-12-02  7:57   ` Thomas Köhler
@ 1998-12-02  8:44     ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1998-12-02  8:44 UTC (permalink / raw)
  To: zsh-users

=?iso-8859-1?Q?Thomas_K=F6hler?= wrote:
> picard ~> bindkey -v
> picard ~> cd /usr/local/bin_
> (hit ^W)
> picard ~> cd /usr/local/_
> (hit ^W)
> picard ~> cd /usr/local_
> 
> Why isn't WORDCHARS honored when in vi-like editing mode?

The binding is vi-backward-kill-word, which uses vi-like word
definitions.  You can bind it emacs mode to get the same effect, but
it's not quite the same because of the way it deletes the delimiter as
a separate word.  Or, you can bind backward-kill-word in vi mode for
the opposite.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-12-02  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-01 22:52 Definition of a word Ollivier Robert
1998-12-02  0:11 ` Phil Pennock
1998-12-02  0:56 ` Jan Kroken
1998-12-02  7:57   ` Thomas Köhler
1998-12-02  8:44     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).