Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: New user questions
- X-seq: zsh-users 2993
- From: Oliver Kiddle <opk@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: New user questions
- Date: Thu, 30 Mar 2000 12:12:47 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <38E2C6AA.62D027CD@xxxxxxxxxxxxxxxxxxxxx> <38E2E5BC.F4A8CB2B@xxxxxxx>
Friedrich Dominicus wrote:
> > Changing separators
> > -------------------
> >
> > All the editor commands define a word separator as a space. Is there a
> > way of changing zsh's idea of word separators? I would prefer that it
> > consider '/' to be a separator as well.
>
> guess zsh makes this automatically. But don't know
Zsh's idea of word separators is defined by the WORDCHARS parameter. It
actually defines characters to be considered part of a word as opposed
to separators. You can remove slash from it:
WORDCHARS="${WORDCHARS:s@/@}"
Personally, I only want slash to be considered a word separator for
moving and deleting words backward and forward - not for other things
like copying the last word so I define my own functions for these which
all look something like this:
tcsh-backward-word() {
local WORDCHARS="${WORDCHARS:s@/@}"
zle backward-word
}
Then I can do:
zle -N tcsh-backward-word
bindkey "..." tcsh-backword-word
Oliver Kiddle
Messages sorted by:
Reverse Date,
Date,
Thread,
Author