I'm looking for a GNU readline alternative, mostly to make sure https://www.oilshell.org/ doesn't become too tied to that interface (which is very hairy).
I did some research and it seems like the only line editors that support vi mode (set -o vi) are GNU readline and libedit (derived from NetBSD with few docs). It looks like it is a few thousand lines of logic in each.
I wonder if this is in scope for bestline? I looked at the code a little and maybe it can be done with an alternative bestlineEdit()? The main difference is that vi is modal and hitting escape brings you into edit mode, but I think that could be handled in such a wrapper.
~/src/readline-8.1$ wc -l vi*.c
875 vi_keymap.c
2408 vi_mode.c
3283 total
~/src/libedit-20210910-3.1/src$ wc -l vi*.c
1160 vi.c
774 vis.c
1934 total
I'm looking for a GNU readline alternative, mostly to make sure https://www.oilshell.org/ doesn't become too tied to that interface (which is very hairy).
https://github.com/oilshell/oil/issues/460
I did some research and it seems like the only line editors that support vi mode (
set -o vi
) are GNU readline and libedit (derived from NetBSD with few docs). It looks like it is a few thousand lines of logic in each.I wonder if this is in scope for bestline? I looked at the code a little and maybe it can be done with an alternative
bestlineEdit()
? The main difference is that vi is modal and hitting escape brings you into edit mode, but I think that could be handled in such a wrapper.minimal docs on vi mode: https://tiswww.case.edu/php/chet/readline/rluserman.html#SEC22