zsh-users
 help / color / mirror / code / Atom feed
From: "Peter Slížik" <peter.slizik@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh <zsh-users@zsh.org>
Subject: Re: A wrong bindkey command breaks the way bck-i-search (Ctrl+R) works
Date: Tue, 27 Jul 2021 12:31:15 +0200	[thread overview]
Message-ID: <CAC-uhUDRrvONS9+BdwNsTCFsng0N42SBBwK=nUK6QyVR_NRFKg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ak9R+ggJh3gsLqa5T47NZs8Ce0f=fSQV0yEhTCr7C2wg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]

Dear Mikael & Bart,

yes, both solutions work.

Taking into account that there are more keymaps, I think that the best
solution would be to remap the keys *only* for the emacs keymap, leaving
the other keymaps untouched.

bindkey -M emacs ' ' expand_abbreviations

But alas, this changes the behavior of isearch, too. The documentation is
really sometimes too wordy and, in cases like this, too terse.

Peter

пон, 26. јул 2021. у 23:10 Bart Schaefer <schaefer@brasslantern.com> је
написао/ла:

> On Mon, Jul 26, 2021 at 8:58 AM Mikael Magnusson <mikachu@gmail.com>
> wrote:
> >
> > On 7/26/21, Peter Slížik <peter.slizik@gmail.com> wrote:
> > >
> > > zle -N expand-abbreviations _expand_abbreviations
> > > bindkey ' ' expand-abbreviations
> > >
> > > The problem with this solution is that it breaks the way that Ctrl+R
> > > history search works.
> >
> > You can use bindkey -M isearch ' ' self-insert to restore the previous
> behavior.
>
> I  believe you could also do
>
> zle -N magic-space _expand_abbreviations
> bindkey ' ' magic-space
>
> because the isearch keymap already understands what (not) to do with
> magic-space.
>

[-- Attachment #2: Type: text/html, Size: 1834 bytes --]

  reply	other threads:[~2021-07-27 10:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 14:13 Peter Slížik
2021-07-26 15:58 ` Mikael Magnusson
2021-07-26 21:10   ` Bart Schaefer
2021-07-27 10:31     ` Peter Slížik [this message]
2021-07-27 14:51       ` Bart Schaefer
2021-07-27 15:09         ` Peter Slížik
2021-07-27 15:42           ` Bart Schaefer
2021-07-27 15:44             ` Peter Slížik
2021-07-27 22:35         ` Mikael Magnusson
2021-07-27 22:38           ` 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='CAC-uhUDRrvONS9+BdwNsTCFsng0N42SBBwK=nUK6QyVR_NRFKg@mail.gmail.com' \
    --to=peter.slizik@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).