knz / go-libedit

Go wrapper around the BSD libedit replacement to GNU readline
Apache License 2.0
6 stars 6 forks source link

Bind keys whenever unbound #6

Open benesch opened 6 years ago

benesch commented 6 years ago

I like to use vim bindings, which means I put the following in my editrc:

bind -v

Unfortunately this wipes away all the bindings installed by this package, like the custom ^C handler and support for ^R, because editrc is sourced after the custom bindings are installed. Can we source editrc first, then install the bindings on any key sequences that are unbound? I looked briefly at the API but didn't see any easy way to accomplish this.

knz commented 6 years ago

Known issue with libedit.

There's a configuration option (I think bind without argument) which dumps all the current settings to stdout/stderr. Do that, start an editline client, then copy the result to your ~/.editrc, then modify the bindings to your liking in there.

Would that work?