#99: Define key bindings in terms of commands rather than other keys
------------------------+---------------------------------------------------
Reporter: korpios | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Version: | Keywords:
------------------------+---------------------------------------------------
Right now, haskeline defines key bindings in terms of other keys; this is
quite confusing compared to other key binding system which define bindings
in terms of particular commands.
For instance, if a user wanted `meta-j` to go back one character,
haskeline expects you to define it in terms of `ctrl-b` rather than a
command like `backward-char`. Furthermore, the current system actually
changes the meaning of your bindings depending on which binding style you
are using; `ctrl-r` may suddenly change meaning from "search backwards" to
"redo" if you switch from emacs to vi style.
It would be much easier to define a non-trivial `~/.haskeline` file like
so:
{{{
bind: ctrl-r backward-char
bind: ctrl-s forward-char
bind: ctrl-b backward-search
bind: ctrl-f forward-search
}}}
...than the current case:
{{{
bind: ctrl-r ctrl-b
bind: ctrl-s ctrl-f
bind: ctrl-b ctrl-r
bind: ctrl-f ctrl-s
}}}
It is immediately clear what the former is doing, and not at all clear
what the latter is. I certainly wouldn't want to puzzle out a
`~.haskeline` file with several dozen bindings as the system currently
stands.
--
Ticket URL: <http://trac.haskell.org/haskeline/ticket/99>
haskeline <http://example.org/>
My example project