vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vile] Minibuffer bindings


From: Decklin Foster
Subject: [vile] Minibuffer bindings
Date: Tue, 29 Jul 2008 13:34:31 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

How can I bind something in the minibuffer? I *think* I want this:

  ; don't use these in normal editing, so make them switch windows
  bind-key next-window ^N
  bind-key previous-window ^P

  ; *do* want these to be emacs-like in the minibuffer
  bind-cmdmode-key next-line ^N
  bind-cmdmode-key previous-line ^P
  bind-cmdmode-key left-arrow ^B
  bind-cmdmode-key right-arrow ^F

Normally ^N/^P DTRT in the minibuffer, but rebinding them in the regular
map breaks that. But maybe I don't want cmdmode? I see this in input.c:

        cfp = ((miniedit)
               ? CommandKeyBinding(c)
               : InsertKeyBinding(c));
 
I rarely (okay, never) use mini-edit; so I guess I just want insmode.
If I turn on insert-exec, I can get ^N/^P/^B/^F working in regular insert
mode, but still nothing in the minibuffer.

^B/^F actually didn't work in the minibuffer to begin with. Trying to
figure out why, I found this in history.c:

        if ((p = DefaultKeyBinding(c)) != 0) {
            if (CMD_U_FUNC(p) == backline)
                h_direction = -1;
            else if (CMD_U_FUNC(p) == forwline)
                h_direction = 1;
        }

So that explains ^N/^P. But shouldn't it be checking CommandKeyBinding
here? Or am I totally on the wrong track as to what bind-cmdmode-key is
for?

-- 
things change.
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]