Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with motion commands defined using match-word-by-style used with vi-delete
- X-seq: zsh-users 10165
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Problem with motion commands defined using match-word-by-style used with vi-delete
- Date: Sat, 22 Apr 2006 13:04:42 +0200
- Cc: "Zsh Users" <zsh-users@xxxxxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ATO9/ae0+rU+6W1DCQupLZt2SrEGdgolJVV+D0qNOznAFYPdAWHtaIOCcabQ+tZkNFLrxj1+DlSTiOhdvBkrOGYRaxKQjGIcv1brjepsoemKrQFn9AMAaDqcIbmozYaklZgyIgNf033CpP/D1di0CEW2uVxDTbfSSUpzt3Zceps=
- In-reply-to: <060421220035.ZM7625@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dbfc82860604211610x70a12466j7eb5bb6758e85c0d@xxxxxxxxxxxxxx> <060421220035.ZM7625@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On 4/22/06, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Apr 22, 1:10am, Nikolai Weibull wrote:
> }
> } [...] $curcontext is set to zle:vi-delete, not, for example,
> } zle:forward-word-match.
> }
> } It seems that this issue can be quite hard to fix, considering how
> } vi-delete is currently implemented. But perhaps there's an easy
> } solution that I was unable to spot.
>
> Try applying this same small change to each of the *-match functions:
>
> --- 8< ---
> @@ -3,7 +3,7 @@
>
> autoload match-words-by-style
>
> -local curcontext=":zle:$WIDGET" word
> +local curcontext=":zle:$WIDGETFUNC" word
> local -a matched_words
> integer count=${NUMERIC:-1}
>
> --- 8< ---
>
> I didn't actually try that because I'm not a vi mode user and I'm in
> a hurry :-/ but it seems like it should do the trick. If it doesn't,
> try ${WIDGETFUNC%-match} instead.
Hm, that sets curcontext to :zle:forward-word-match (or
:zle:forward-word), which means it won't be possible to use zstyles
anymore.
The following is what I'm using:
autoload -U forward-word-match
autoload -U backward-word-match
zle -N forward-parameter forward-word-match
zle -N backward-parameter backward-word-match
zstyle ':zle:forward-parameter' word-style shell
zstyle ':zle:backward-parameter' word-style shell
bindkey -a ")" forward-parameter
bindkey -a "(" backward-parameter
> } Until then I'm going to use my own vi-delete
>
> Creating a vi-delete-match function seems like the next best thing.
That's what I meant (I think) :-).
nikolai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author