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

Add support for vim mode in Text Editor #90

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

krassowski
Copy link
Collaborator

Relates to jupyterlab/jupyterlab#14599

Code changes

  • Splits VimEditorManager out of VimCellManager
  • Adds a file-editor specific shortcut to workaround escape being stolen by (hidden) search box in file editor

User facing changes

Screenshot from 2023-07-31 19-48-14

Screenshot from 2023-07-31 19-44-53

@krassowski krassowski added the enhancement New feature or request label Jul 31, 2023
@github-actions
Copy link

Binder 👈 Launch a Binder on branch krassowski/jupyterlab-vim/file-support

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch krassowski/jupyterlab-vim/file-support

@ianhi
Copy link
Collaborator

ianhi commented Jul 31, 2023

I'm finding that whenver I enter an editor I'm entering in insert mode, rather than normal mode (which is what we do for notebooks) is it easy to enter into normal mode for consistency?

@ianhi ianhi mentioned this pull request Jul 31, 2023
@ianhi
Copy link
Collaborator

ianhi commented Jul 31, 2023

one other weird thing, it seems that modifyEditor gets called every time I hit Esc when in a fileeditor. Probably not optimal, but also doesn't seem to be a big deal

@krassowski
Copy link
Collaborator Author

krassowski commented Jul 31, 2023

one other weird thing, it seems that modifyEditor gets called every time I hit Esc when in a fileeditor. Probably not optimal, but also doesn't seem to be a big deal

This is because of the shortcut in schema bound to vim:enter-normal-mode which is a workaround for search box stealing Esc (in 4.0, once 4.1 is out we should be able to drop it). It should be innocent as the heavy operations in modifyEditor are guarded.

@krassowski
Copy link
Collaborator Author

I'm finding that whenver I enter an editor I'm entering in insert mode, rather than normal mode (which is what we do for notebooks) is it easy to enter into normal mode for consistency?

Resolved in bf589e5

@ianhi
Copy link
Collaborator

ianhi commented Jul 31, 2023

perfect! Thank you again! I think this would have taken me days of confusion to get something like this going.

@ianhi ianhi merged commit de8afca into jupyterlab-contrib:master Jul 31, 2023
5 checks passed
@krassowski
Copy link
Collaborator Author

Thank you for super quick review and releases!

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 this pull request may close these issues.

2 participants