Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interest in vi mode? #15

Open
andychu opened this issue Jan 22, 2022 · 1 comment
Open

interest in vi mode? #15

andychu opened this issue Jan 22, 2022 · 1 comment

Comments

@andychu
Copy link

andychu commented Jan 22, 2022

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).

oils-for-unix/oils#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.

~/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

minimal docs on vi mode: https://tiswww.case.edu/php/chet/readline/rluserman.html#SEC22

@cassepipe
Copy link

...or at least an option to open the command line in $EDITOR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants