zsh-users
 help / color / mirror / code / Atom feed
From: "Nikolai Weibull" <now@bitwi.se>
To: "Bart Schaefer" <schaefer@brasslantern.com>
Cc: "Zsh Users" <zsh-users@sunsite.dk>
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	[thread overview]
Message-ID: <dbfc82860604220404m121e4659i12a9cc901717a191@mail.gmail.com> (raw)
In-Reply-To: <060421220035.ZM7625@torch.brasslantern.com>

On 4/22/06, Bart Schaefer <schaefer@brasslantern.com> 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


  reply	other threads:[~2006-04-22 11:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 23:10 Nikolai Weibull
2006-04-22  5:00 ` Bart Schaefer
2006-04-22 11:04   ` Nikolai Weibull [this message]
2006-04-22 18:35     ` Bart Schaefer
2006-04-22 21:38       ` Nikolai Weibull
2006-04-23  6:09         ` Bart Schaefer
     [not found]           ` <dbfc82860604230157h52f91585ncfd5a984a1a08c67@mail.gmail.com>
2006-04-23 15:53             ` Bart Schaefer
2006-04-23 16:13               ` Nikolai Weibull
2006-04-23 23:08               ` Peter Stephenson
2006-04-24 19:39                 ` Nikolai Weibull
2006-04-25  3:06                   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbfc82860604220404m121e4659i12a9cc901717a191@mail.gmail.com \
    --to=now@bitwi.se \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).