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

ENH: add a setting to bind esc to leave-current-mode #101

Closed
ianhi opened this issue Aug 4, 2023 · 2 comments · Fixed by #110
Closed

ENH: add a setting to bind esc to leave-current-mode #101

ianhi opened this issue Aug 4, 2023 · 2 comments · Fixed by #110
Labels
enhancement New feature or request

Comments

@ianhi
Copy link
Collaborator

ianhi commented Aug 4, 2023

We should add a setting that allows binding Esc to leave-current-mode as proposed in #70

@ianhi ianhi added the enhancement New feature or request label Aug 4, 2023
@firai
Copy link
Collaborator

firai commented Aug 4, 2023

It seems like the search box Esc binding for JL 4.0.x that was added in #90 needs to be disabled in order for double duty Esc à la #70 to work in JL 4.0.x. As far as I can tell, closing the search box by Esc still seems to work in notebooks in JL 4.0.x without the extra search box binding, probably because of the .jp-mod-searchable-wide binding. I don't know what's going to happen in 4.1.x. EDIT: Removed in 4.0.3.

You can add the following to the shortcut bindings to enable this feature. The leave-insert-mode binding needs to be disabled if the following is added as a user preference and if one starts from the auto-generated shortcut bindings rather than blank settings. Obviously this would be done if it was done from the extension itself.

{
    "shortcuts": [

        // The additional settings start here
        {
            "args": {},
            "command": "vim:leave-current-mode",
            "keys": [
                "Escape"
            ],
            "selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-editMode"
        }
        // The additional settings end here

    ]
}

@firai
Copy link
Collaborator

firai commented Sep 10, 2023

A proposed implementation has been opened at #110. Comments are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants