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

4.0.0 lacks selectable key map #14599

Open
drewlio opened this issue May 26, 2023 · 9 comments
Open

4.0.0 lacks selectable key map #14599

drewlio opened this issue May 26, 2023 · 9 comments
Labels
enhancement tag:Regression Behavior that had been broken, was fixed, and is broken again
Milestone

Comments

@drewlio
Copy link

drewlio commented May 26, 2023

Problem

4.0.0 appears to lack the selectable key map feature to allow a user to choose vim/emacs/sublime mode for cell editing. However, in the Jupyterlab documentation on the interface for version latest it does appear as a feature.

Proposed Solution

I understand there has a been a change to codemirror and that codemirror supports vim keymaps. Can we get this feature on the roadmap for Jupyterlab? Or alternatively, is there a way for users to add this?

Thank you so much.

Additional context

@welcome
Copy link

welcome bot commented May 26, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label May 26, 2023
@krassowski krassowski added the tag:Regression Behavior that had been broken, was fixed, and is broken again label May 27, 2023
@krassowski
Copy link
Member

Thank you for highlighting this.

and that codemirror supports vim keymaps.

This links to CodeMirror 5 documentation. JupyterLab 4 uses CodeMirror 6, which does not ship alternative keymaps, but extensions can still define custom keymaps. Here are three CodeMirror 6 extensions from replit defining keymaps which we could use:

I believe that in CodeMirror 6 migration follow-up the keymap setting was removed but documentation was not updated. Personally I would be in favour of reinstating keymaps using replit extensions and would be happy to help with this.

@krassowski krassowski added this to the 4.0.x milestone May 27, 2023
@JasonWeill JasonWeill removed the status:Needs Triage Applied to new issues that need triage label May 30, 2023
@firai
Copy link
Contributor

firai commented Jun 13, 2023

Personally I would be in favour of reinstating keymaps using replit extensions and would be happy to help with this.

By the way, it would be good to know whether the JL team prefers to or will likely add keymaps back to JL 4 as a core feature. I think the jupyterlab-vim team, i.e., @ianhi, was assuming that the plugin would have to inject the replit vim keymap (see jupyterlab-contrib/jupyterlab-vim#68 (comment)), which makes updating the extension for JL 4 a little bit more daunting.

@krassowski
Copy link
Member

krassowski commented Jun 17, 2023

We discussed this on the team meeting and there were no voices against including the key maps in core. Especially lack of codemirror-vim keymap seems to be a regression so this is open for PRs.

@ianhi
Copy link
Contributor

ianhi commented Jun 17, 2023

So the prior behavior i.e. jlab3 was core had selectable keymaps for the file editor, but not for notebooks. jupyterlab-vim brought it to the notebook. Was the proposal in the meeting for just the file editor, or for both notebook and fileeditor?

@krassowski
Copy link
Member

I did mention that it was specific to file editor. In JL 4 it is currently difficult to add document-type (notebook vs file editor)-specific extension (I am hitting this with lsp now) but in principle it is possible. Would you see it as beneficial to have it for both file editor and notebook?

@zaneselvans
Copy link
Contributor

I would definitely find it useful to have alternative (vi) keybindings available in the notebooks. I don't use the file editor, but have gotten very used to having the vi keybindings available in as many text editing contexts as possible (VS Code, Jupyter, and vim itself of course). Without the alternative keybindings I'll probably give working with notebooks in VS Code a try, but I would prefer to continue using the open source interface.

@ianhi
Copy link
Contributor

ianhi commented Jul 14, 2023

Would you see it as beneficial to have it for both file editor and notebook?

The notebook is really the critical part from my perspective. The fileeditor at the same time would be a nice bonus. Historically jlab core provided vim only in the fileeditor, which ended up being a source of some user confusion.

@krassowski
Copy link
Member

jupyterlab-vim already supports JupyterLab 4.0: https://github.com/jupyterlab-contrib/jupyterlab-vim/releases/tag/v4.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement tag:Regression Behavior that had been broken, was fixed, and is broken again
Projects
None yet
Development

No branches or pull requests

6 participants