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

Updates for Jupyterlab 4 #68

Closed
ianhi opened this issue Aug 9, 2022 · 15 comments · Fixed by #85
Closed

Updates for Jupyterlab 4 #68

ianhi opened this issue Aug 9, 2022 · 15 comments · Fixed by #85
Assignees
Labels
enhancement New feature or request

Comments

@ianhi
Copy link
Collaborator

ianhi commented Aug 9, 2022

EDIT - How to get working jlab4

Version 0.17.0 and up should work in jlab4 please upgrade via python -m pip install jupyterlab_vim --upgrade


I looks as thought jupyterlab 4 will use codemirror 6: jupyterlab/jupyterlab#11638 which drops the built in vim.

Fortunately it looks like replit has taken over maintenance of the vim extension and has updated it for CM6: https://github.com/replit/codemirror-vim#vim-keybindings-for-cm6. We should try to implement using this new package well before release to see if any changes in jlab will be necessary for this extension to continue to work.

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

firai commented Aug 13, 2022

I understand from replit/codemirror-vim that the new extension needs to be loaded in the CM extension configuration before all other keymaps, including the basic one. I'm looking at the new JLab 4 API architecture, but I haven't figured out yet whether it allows replacing the keymap in the EditorConfiguration in packages/codemirror/src/editorconfiguration.ts, which is eventually be fed into EditorView of createEditor in packages/codemirror/src/editor.ts. It seems like injectExtension of EditorConfiguration only appends the extension in the configuration, which (I presume) would not achieve what the CM vim extension requires.

@firai
Copy link
Collaborator

firai commented Aug 18, 2022

By the way, it seems like this upcoming JLab PR might also have a significant impact on the upgrade? jupyterlab/jupyterlab#12554

@ianhi
Copy link
Collaborator Author

ianhi commented Aug 19, 2022

thanks @firai! I left a comment on that PR asking about this.

I'm looking at the new JLab 4 API architecture, but I haven't figured out yet whether it allows replacing the keymap in the EditorConfiguration in packages/codemirror/src/editorconfiguration.ts, which is eventually be fed into EditorView of createEditor in packages/codemirror/src/editor.ts. It seems like injectExtension of EditorConfiguration only appends the extension in the configuration, which (I presume) would not achieve what the CM vim extension requires.

We may need to open an issue on jlab to discuss this. Probably better to do so sooner rather than later if we are going to need changes in jlab. Unfortunately I don't think I'll have the bandwidth to think about this for the next few weeks - so if anyone wants to take the lead on pushing on this please do :)

@firai
Copy link
Collaborator

firai commented Aug 19, 2022

Thanks @ianhi! Is it worth mentioning in your comment on the JLab windowing PR that the replit/codemirror-vim keymap has to be before the others in the init in order to work, rather than just adding it to the end?

@ianhi
Copy link
Collaborator Author

ianhi commented Aug 21, 2022

Is it worth mentioning in your comment on the JLab windowing PR that the replit/codemirror-vim keymap has to be before the others in the init in order to work, rather than just adding it to the end?

yup definitely worthwhile. I think we ought to compile a starting list of what APIs we need that don't exist in the new API an open an issue about that.

@firai
Copy link
Collaborator

firai commented May 6, 2023

It seems like JLab 4 has now hit RC status. The extension migration guide is at https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html.

@rsaavedraxyz
Copy link

It seems like JLab 4 has now hit RC status. The extension migration guide is at https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html.

I tried running the script but the extension still does not work in Jupyterlab 4.

@ianhi
Copy link
Collaborator Author

ianhi commented May 18, 2023

I tried running the script but the extension still does not work in Jupyterlab 4.

I think that that script is necessary but not sufficient. The source of the vim bindings will also need ot be updated as they no longer ship with codemirror. We will now need to get them via: https://github.com/replit/codemirror-vim#vim-keybindings-for-cm6

Finally we will likely also have to change how we interact with jupyterlab codemirror as it seems that that interface has also changed.

@OracleMachine
Copy link

I tried running the script but the extension still does not work in Jupyterlab 4.

I think that that script is necessary but not sufficient. The source of the vim bindings will also need ot be updated as they no longer ship with codemirror. We will now need to get them via: https://github.com/replit/codemirror-vim#vim-keybindings-for-cm6

Finally we will likely also have to change how we interact with jupyterlab codemirror as it seems that that interface has also changed.

As an avid user of the JupyterLab-Vim extension, I'm eager to contribute to its updates. Can you provide an overview of the current plan? I may be relatively new to developing JupyterLab extensions, but I've familiarized myself with the documentation. It seems we might need to reconfigure the Vim bindings to accommodate the Replit version of the CodeMirror interface. Please let me know how I can assist in this process.

@vilanele
Copy link

Hello,

I'm an avid user of JupyterLab-Vim too and first I thank you for your work. For now I'm using JupyterLab version 3.6.x, but it should be great to have it working on 4.x.x. If I can assist I'll be pleased let me know.

Just few words of encouragement.

@paul-turing-ml
Copy link

Also just chiming in to say thanks to everyone who has worked / is working on this project - I can barely function without it! Is there some place I can donate? Or if I can provide some other sort of support, please let me know.

@dirkroorda
Copy link

I got to the point that I have tried VSCode for running Jupyter notebooks. It's been a good experience so far. Easy to get vim bindings and black working in code cells.
It's a pity that the vim bindings have not made it to the main Jupyter code.
Thanks for this extension that has been a much appreciated asset when working in JupyterLab!

@krassowski
Copy link
Collaborator

A PR adding support for JupyterLab 4.0 is up: #85 - please help with testing and review.

@ianhi ianhi closed this as completed in #85 Jul 30, 2023
@ianhi
Copy link
Collaborator Author

ianhi commented Jul 31, 2023

#85 has been merged and released!

Install

python -m pip install jupyterlab_vim --upgrade in an environment with jupyterlab4 should get you working install.

Thanks

Huge thanks to @krassowski for doing the work on converting the extension!

@dirkroorda
Copy link

I'm back with JupyterLab. After a short spell of using VSS code.

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
Development

Successfully merging a pull request may close this issue.

8 participants