Ticket #90 (new defect)

Opened 8 years ago

Last modified 5 years ago

vi mode printable char bindings should not be bound in input mode

Reported by: cjs Owned by:
Priority: major Milestone:
Version: 0.6 Keywords:


This ~/.haskelline file:

editMode: Vi bind: k up bind: j down

behaves in a rather unfortunate way for vi users. As well as binding h and j in command mode, it also binds them in input mode, meaning that one can no longer input a k or a j.

Ideally one would specify, for vi bindings, whether they were for command mode or input mode. However, this requires changing the format of the configuration file, possibly making it rather more complex.

My proposal is that, for the moment anyway, bind when used with printable characters should rebind keys for command mode only, not affecting their use in input mode.


.haskeline (84 bytes) - added by Émeric 5 years ago.
cbind.diff (10.3 kB) - added by Émeric 5 years ago.

Change History

Changed 8 years ago by judah

However, there's some legitimate uses of binding printable characters in insert mode; e.g. see the "sequence macros" section of CustomKeyBindings.

Maybe there should be a way to mark bindings as only applying when in a specific mode.

Changed 8 years ago by cjs

Right. I'd prefer a way to mark bindings as applying only in a specific mode.

Come to think of it, we probably want separate bindings for vi and emacs modes, as well, so that if someone switches back and forth they don't have to change all their bindings as well. Thus, perhaps we should add a bindv mode key value command.

Changed 5 years ago by Émeric

Changed 5 years ago by Émeric

Changed 5 years ago by Émeric


here is a quick and dirty patch to define command only binding.

I really needed this functionality (I use readline vi mode a lot but with a french dvorak keyboard which mean I need to map jklm to tsrn), so I post this if it can helps.

Being new to haskell I'm quite sure it is not the right way to implement this, but it works for me, I'll be glad to see a clean implementation of key binding for command mode in the future,


Note: See TracTickets for help on using tickets.