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

Toggle between cell types using a single key #7596

Closed
zzra opened this issue Mar 4, 2025 · 4 comments
Closed

Toggle between cell types using a single key #7596

zzra opened this issue Mar 4, 2025 · 4 comments

Comments

@zzra
Copy link

zzra commented Mar 4, 2025

Problem

I am consistently frustrated when using Jupyter Notebook in VIM mode due to accidentally changing the cell type and becoming stuck in the new type. Since changing from cell type to cell type is dependent on 3 keys I cannot simple repeat what I've done to change the cell type. Instead I am required to find the obscure new shortcut to do so and only that shortcut will change me to the type I want. Additionally there are extra ways to set a cell to markdown using keys '1' ... '6' which are equally frustrating given the context of a specific shortcut to switch to code.

I would greatly appreciate it if one key rotated through the cell types.

Proposed Solution

Create a function that switches cell type to the next in order.

Example:

  1. My cell type is 'Code'
  2. I click key 'anyKey'
  3. My cell type is 'Markdown'
  4. I click key 'anyKey'
  5. My cell type is 'Raw'
  6. I click key 'anyKey'
  7. My cell type is 'Code'

This can be accomplished without a dedicated key to prevent regular users from being confused by the new shortcut. Instead it will be found by confused uses when searching 'Keyboard Shortcuts' for 'Code', 'Cell', 'Type', 'Markdown', 'Raw', 'Change' or any other reasonable query/combination for changing type.

Or use a key like 'W' which hasn't been used yet.

Additional context

What this solves: simplifies user onboarding by reducing cognitive load to get started.

@zzra zzra added enhancement status:Needs Triage Applied to issues that need triage labels Mar 4, 2025
@krassowski
Copy link
Member

Additionally there are extra ways to set a cell to markdown using keys '1' ... '6' which are equally frustrating given the context of a specific shortcut to switch to code.

I feel this pain often.

It looks like a "Cycle Cell Type" command would be a reasonable addition. I would argue that assigning a shortcut by default is a more involved decision, but if Notebook ship a command, users could set a shortcut themselves for this command.

@ericsnekbytes
Copy link
Collaborator

@zzra Thanks for creating this issue. Since the enhancement proposal for a "Cycle Cell Type" command is best tracked on the JupyterLab repo, I made an issue there to track it (if you have any more feedback, please follow up there). If the enhancement is completed, it will then be available to all JupyterLab and Notebook users :)

If you need additional changes for the VIM extension, please follow up with the extension authors. Thanks!

@ericsnekbytes ericsnekbytes removed the status:Needs Triage Applied to issues that need triage label Mar 4, 2025
@andrii-i
Copy link
Contributor

andrii-i commented Mar 4, 2025

Hi everyone. Thank you for creating and/or looking into this issue. Taking in account that this issue is now tracked in newly created issue jupyterlab/jupyterlab#17366, should this issue be closed?

@zzra
Copy link
Author

zzra commented Mar 4, 2025

Closing seems fine to me since its triaged.

@zzra zzra closed this as completed Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants