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 10168
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Zsh Users" <zsh-users@xxxxxxxxxx>
- Subject: Re: Problem with motion commands defined using match-word-by-style used with vi-delete
- Date: Sat, 22 Apr 2006 23:09:29 -0700
- In-reply-to: <dbfc82860604221438i51d3a8e0tc06b0b5c90d40cb6@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dbfc82860604211610x70a12466j7eb5bb6758e85c0d@xxxxxxxxxxxxxx> <060421220035.ZM7625@xxxxxxxxxxxxxxxxxxxxxx> <dbfc82860604220404m121e4659i12a9cc901717a191@xxxxxxxxxxxxxx> <060422113544.ZM9246@xxxxxxxxxxxxxxxxxxxxxx> <dbfc82860604221438i51d3a8e0tc06b0b5c90d40cb6@xxxxxxxxxxxxxx>
On Apr 22, 11:38pm, Nikolai Weibull wrote:
}
} I'm positive that there's a way to do this, but I can't see it, so any
} help is welcome.
In the short term, I think it'd work to reset $WIDGET yourself:
local WIDGET=$motion_command
zle $motion_command -n $count
} I'm sure it'll break all kinds of stuff, but one solution would be to
} have getvirange() set bindk to k2 once it has been read and checked.
I don't think that's sufficient. getvirange() would have to fiddle with
saving and restoring some other state around the call to execzlefunc().
} Also, it would be great if we had a switch for bindkey that made it
} print the widgets name, nothing else.
It' be better if we had a $bindings associative array to go with $keymaps
and $widgets, and a zle function along the lines of recursive-edit except
it reads only one binding. For example, it's rather messy to reimplement
describe-key-briefly in the shell:
describe-key-briefly() {
setopt localoptions extendedglob
local -a bound rebound
local b f=__-get-widget-name
bindkey -N __ $KEYMAP
bound=( ${${(f)"$(bindkey -M __ -L)"}/(#b)([^[:space:]]#)(#e)/__-$match} )
rebound=( ${(u)bound##* } )
function $f {
zle -M "${(V)KEYS} is ${WIDGET#__-}"
zle .accept-line # end recursive-edit
}
for b in $rebound
do
zle -N $b $f
done
eval "${(j:;:)bound}"
# Cf. read-from-minibuffer if you insist on having
# correct cursor placement during this prompt
zle -M "Describe key briefly: "
zle .recursive-edit -K __
}
This may suggest another way to implement vi-delete-match, though. Hmm.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author