Ido and Vimpulse/Viper and C-p, C-n

Nikolai Weibull now at bitwi.se
Sat Apr 16 11:43:43 CEST 2011


On Fri, Apr 15, 2011 at 17:07, Vegard Øye <vegard_oye at hotmail.com> wrote:
> On 2011-04-15 12:58 +0100, Nikolai Weibull wrote:

>> Is there any way of getting C-p and C-n do ido-prev-match and
>> ido-next-match in Ido mode?

> As it turns out, `ido-setup-hook' is not executed in the minibuffer,
> so `viper-add-local-keys' creates a buffer-local binding for the main
> buffer instead. (`ido-minibuffer-setup-hook' /is/ executed in the
> minibuffer, though).

Aha.

> However, buffer-local bindings are a bad fit in any case, since
> they will linger when the minibuffer is used for other things.

OK.

> Command remapping works better:
>
>    (add-hook 'ido-setup-hook
>              (lambda ()
>                (define-key ido-completion-map [remap vimpulse-abbrev-expand-before] 'ido-prev-match)
>                (define-key ido-completion-map [remap vimpulse-abbrev-expand-after] 'ido-next-match)))

I tried that, but in a different keymap.

> (Normally, `vimpulse-define-key' is used in these cases, but it works
> at the mode level and isn't really fine-grained enough for the
> minibuffer. Ido mode is seen as "active" both in the main buffer and
> the minibuffer, while the `ido-completion-map' keymap is active /only/
> in the minibuffer (by shadowing `minibuffer-local-completion-map').

Jeesh, there’s got to be more terminology than non-terminology in
those two sentences…

Thank you for a very informative answer.



More information about the implementations-list mailing list