Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A wrong bindkey command breaks the way bck-i-search (Ctrl+R) works



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@xxxxxxxxxxxxxxxx> је написао/ла:
On Mon, Jul 26, 2021 at 8:58 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 7/26/21, Peter Slížik <peter.slizik@xxxxxxxxx> 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.


Messages sorted by: Reverse Date, Date, Thread, Author