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

Start in vi navigation mode #1631

Open
MatrixManAtYrService opened this issue May 9, 2022 · 0 comments · May be fixed by #1632
Open

Start in vi navigation mode #1631

MatrixManAtYrService opened this issue May 9, 2022 · 0 comments · May be fixed by #1632

Comments

@MatrixManAtYrService
Copy link

Hi. Thanks for prompt-toolkit. It's great.

I'm working on an application that populates the text area and then asks the user to delete parts of it, so the natural way to start is not in InputMode.INSERT but instead in InputMode.NAVIGATION.

I've been playing around with things like this:

    app = Application(
        key_bindings=kb, layout=Layout(root_container), editing_mode=EditingMode.VI
    )
    app.vi_state.input_mode = InputMode.NAVIGATION
    app.run()

But the app still starts in insert mode. I think that Application is calling reset() which is setting it back to insert mode.

Is there a recommended way to do this?

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