Context Navigation

Ticket #82
(new enhancement)

Custom key actions written in Haskell

Reported by:

guest

Owned by:

Priority:

minor

Milestone:

Version:

0.6

Keywords:

Cc:

Description

My ~/.inputrc maps <up> and <down> to history-search-backward and history-search-forward in programs that use readline. This functionality is simply not available in haskeline. If it was, I couldn't bind it to <up>/<down> because as far as I can see haskeline only offers vi-style key remapping, not binding to input editing functions. There also doesn't seem to be a way to add actions from Haskell; getInputLine is a black box without hooks.

So what I want right now is history-search-backward/forward but I also think there should be a comprehensive set of bindable line editing functions and a way to define new functions in Haskell.

By default, history search is bound to ctrl-r and ctrl-s. You can rebind those commands to up/down by adding the following commands to a ~/.haskeline file:

bind: up ctrl-r
bind: down ctrl-s

I agree it would be nice to be able to define new functions in Haskell using some sort of plugins functionality similar to that of xmonad or yi. However, it's unclear to me whether this is feasible since those are standalone applications, whereas Haskeline is a library used by multiple programs.