vile
[Top][All Lists]
Advanced

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

Re: [vile] Minibuffer bindings


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

Thomas Dickey writes:

> It's supposed-to make bindings in any of the non-default maps override
> the default map.  (If not, it's a bug).

It meaning the cmdmode map? Can you give an example of what this could
be useful for? I don't think I quite get it (sorry).

Can I somehow remove my weirdo ^N/^P bindings just for the case of
editing history? Or can I get them in normal mode without touching the
default map, thus leaving the history-scrolling intact? cmdmode didn't
seem to do that.

> But insmode only applies to regular buffers.
> 
> The default editing of the command-line is essentially hardcoded (aside from
> the characters you can see with show-terminal-chars).  Likewise the history
> mechanism.  That's partly because they're very specialized editing modules
> that do things like name-completion.

I guess this is my problem; I want to bind arbitrary things in the history
editor, which it was not really designed for.

(This was all motivated by not wanting to reach for the arrow keys, which
do of course always work. But they require using an Fn key on my Happy
Hacking Keyboard.)

> I think that would be done up in input.c - though making the seams between
> input.c and history.c not visible does take work.

How crazy would it be to make a "mode" for history as well as insert,
and everything a bindable function? To take a simpler example...

In insert mode, when I turned insert-exec on, I could still use ^T to
indent but not ^D to outdent, because ^D is of course normally bound
to next-half-page. I looked in the docs and it appears that the normal
indentation operations are not functions, but hardcoded somewhere.
Also, hitting enter stopped working. I was able to fix things with this:

  ; among other things...
  unbind-insmode-key ^D
  unbind-insmode-key ^M

With no bindings, they fell back to the "default" special meanings, but
it seems to me that these operations could theoretically be functions
bound to those keys (so that there would not need to be insert-exec mode
at all; it would be as if it were always on). The insmode map would have
to not inherit anything from the default map (why does it do that now?).

(Actually, binding ^M to newline worked, which is an example of how
I am imagining this working.)

Similarly, all the specialized stuff in the history editor like tab
completion is not exposed as functions. This is surely much hairier,
because of all the interactive prompts and stuff, but maybe (possibly?)
it could be implemented in the same way. It might be nice to be able to
bind tab to some kind of completion in regular old insert mode.

I guess you could consider this a feature request, but (due to all the
things that would need to be torn up) not one I'd expect this decade :-)
If you think abolishing insert-exec (because we have insmode bindings)
is reasonable but not a priority, I could try to give it a shot someday
when I have time.

-- 
things change.
address@hidden




reply via email to

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