From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 9f3fb654 for ; Fri, 10 Jan 2020 11:47:45 +0000 (UTC) Received: (qmail 12400 invoked by alias); 10 Jan 2020 11:47:39 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24630 Received: (qmail 8841 invoked by uid 1010); 10 Jan 2020 11:47:39 -0000 X-Qmail-Scanner-Diagnostics: from mail-il1-f181.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(209.85.166.181):SA:0(-2.0/5.0):. Processed in 2.249925 secs); 10 Jan 2020 11:47:39 -0000 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.181 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CrSEYCSsF5TAXw8RwDPcOXKjT237x2bBeX31vZfD1Mo=; b=QrsEphbMP3DNE9UlfQ7+hquwFlDa5shAa+pRKGaiQdj/5lYarmO5TrFXo1uLBgpiUR syBXxjGmPDy5ZLNxtg11N023oRGJqqwxYczNMj9jkfbZSibBzdTbuHj0rso9es+WsrLj eqmEOPsHiZBC8MLbVP+imMPiUL3Xv8qNLVnpVGkc9wEeraddygpTMJiemUNyejfvsfXR t6/Uwh94PRX1jwflBa2pY7U455PALwyDoTn71mb+oKLCtrlf3wmiRpWpbJS4/2Na4mMd TqgNyTwJUj/lTreB5/B23MSnxfPYL6zy+mKjK4RI+SsYr1RMF9CX0MKOQkJubJ14+xKB 81xA== X-Gm-Message-State: APjAAAX/9N/3VHdXHKlrDnzWuzQTgrKdLlsKa7XLmjX8loS1lCHvmXo3 PiN8bbK2OBcDwGmZDJ/u7dmEUINwY7ennWkQSfQ= X-Google-Smtp-Source: APXvYqycd4ttALckSa4cqsD8k0PzZYwIMjMdIZ3ndqRDk8QAudBPrTGNGqt8zzA5sM6zvzRtBVRdmmmk/6DiCmL5t9w= X-Received: by 2002:a92:4016:: with SMTP id n22mr2318134ila.13.1578656823119; Fri, 10 Jan 2020 03:47:03 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1578653890.5278.5.camel@samsung.com> References: <1578477603.6726.5.camel@samsung.com> <1578580166.6028.9.camel@samsung.com> <68da78c1-61b2-6467-d5c6-710b0c7c5d1e@gmail.com> <1578649908.5278.2.camel@samsung.com> <1578653890.5278.5.camel@samsung.com> From: Mikael Magnusson Date: Fri, 10 Jan 2020 12:47:02 +0100 Message-ID: Subject: Re: emulate bash key bindings To: Peter Stephenson Cc: "zsh-users@zsh.org" Content-Type: text/plain; charset="UTF-8" On 1/10/20, Peter Stephenson wrote: > Here's an example of the re-using a match widget for a specific style. > > pws > > diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo > index d51fd518b..1e335d29d 100644 > --- a/Doc/Zsh/contrib.yo > +++ b/Doc/Zsh/contrib.yo > @@ -2227,7 +2227,20 @@ is set in the context tt(:zle:*) to tt(true) if the > word style is > tt(bash) and tt(false) otherwise. It may be overridden by setting it in > the more specific context tt(:zle:forward-word*). > > -Here are some examples of use of the styles, actually taken from the > +It is possible to create widgets with specific behaviour by defining > +a new widget implemented by the appropriate generic function, then > +setting a style for the context of the specific widget. For example, > +the following defines a widget tt(backward-kill-space-word) using > +tt(backward-kill-word-match), the generic widget implmenting implementing > +tt(backward-kill-word) behaviour, and ensures that the new widget > +always implements space-delimited behaviour. > + > +example(zle -N backward-kill-space-word backward-kill-word-match > +zstyle :zle:backward-kill-space-word word-style space) > + > +The widget tt(backward-kill-space-word) can now be bound to a unfinished sentence, presumably "key" is missing? > + > +Here are some further examples of use of the styles, actually taken from > the > simplified interface in tt(select-word-style): -- Mikael Magnusson