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

keybindings of jupyter notebook #281

Closed
Windrain7 opened this issue Nov 28, 2022 · 10 comments
Closed

keybindings of jupyter notebook #281

Windrain7 opened this issue Nov 28, 2022 · 10 comments
Assignees
Milestone

Comments

@Windrain7
Copy link

After the tool is enabled, the keybindings of jupyter notebook is also modified. For example, ctrl+enter cannot execute the current cell.

@kasecato kasecato self-assigned this Jan 4, 2023
@kasecato kasecato added this to the v1.5.8 milestone Apr 2, 2023
kasecato added a commit that referenced this issue Apr 2, 2023
Fixed #281 that keep Notebook keybindings
@kasecato
Copy link
Owner

kasecato commented Apr 2, 2023

@Windrain7 seems it was enabled notebook plugin by default in VS Code, and it was duplicated some keybindings. Released v.1.5.8, please check it

@kasecato kasecato reopened this Apr 2, 2023
@Windrain7
Copy link
Author

@Windrain7 seems it was enabled notebook plugin by default in VS Code, and it was duplicated some keybindings. Released v.1.5.8, please check it

Now shift+enter can run the current cell and move to the next cell, but ctrl+enter cannot run the current cell.

@kasecato
Copy link
Owner

kasecato commented Apr 4, 2023

Ah, you're using macOS right?
I found the keybindings of macOS binds Ctrl+Enter to Notebook: Execute Cell and Notebook: Stop Editing Cell.
Let me fix it on v1.5.9

@kasecato kasecato modified the milestones: v1.5.8, v1.5.9 Apr 4, 2023
kasecato added a commit that referenced this issue Apr 4, 2023
kasecato added a commit that referenced this issue Apr 4, 2023
Fixed #281 that enabled notebook execute
@kasecato
Copy link
Owner

kasecato commented Apr 4, 2023

@Windrain7 I just released v1.5.9, please check it

@kasecato kasecato reopened this Apr 4, 2023
@Windrain7
Copy link
Author

Ah, you're using macOS right? I found the keybindings of macOS binds Ctrl+Enter to Notebook: Execute Cell and Notebook: Stop Editing Cell. Let me fix it on v1.5.9

Actually, I am using Windows. When I use v1.5.9, ctrl+enter still cannot execute the current cell.

@kasecato
Copy link
Owner

kasecato commented Apr 4, 2023

Windows/Linux default keybinding is ctrl+alt+enter. macOS is ctrl+enter. Do you want to change it to ctrl+enter for Windows?

@Windrain7
Copy link
Author

Windows/Linux default keybinding is ctrl+alt+enter. macOS is ctrl+enter. Do you want to change it to ctrl+enter for Windows?

To be more specific, I use the Windows and Pycharm. Jupyter Notebook originally bound Ctrl+Enter to the Run Cell, and Shift+Enter to the Run Cell and Select Below . However, these shortcuts conflict with original shortcuts of Pycharm. So when running Jupyter notebook in Pycharm, it made changes to the shortcuts. Pycharm following the rules of Jupyter Notebook, still binds Ctrl+Enter to Run Cells and Shift+Enter to Run Cell and Select Below, giving up the original effects of these shortcuts.

@ICHx
Copy link

ICHx commented Mar 2, 2024

I am using mac and the jupyter.runcurrentcelladvance conflicts with editor.action.insertLineAfter, both using shift+enter

@kasecato
Copy link
Owner

Need to add a lot of shift+enter mappings

  • Windows/Linux
{
  "key": "shift+enter",
  "command": "jupyter.runcurrentcelladvance",
  "when": "editorTextFocus && isWorkspaceTrusted && jupyter.hascodecells && !editorHasSelection && !notebookEditorFocused"
},
{
  "key": "shift+enter",
  "command": "jupyter.execSelectionInteractive",
  "when": "editorTextFocus && isWorkspaceTrusted && jupyter.ownsSelection && !findInputFocussed && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'"
},
{
  "key": "shift+enter",
  "command": "notebook.cell.executeAndSelectBelow",
  "when": "notebookCellListFocused && !inlineChatFocused && notebookCellType == 'markup' || notebookCellListFocused && notebookMissingKernelExtension && !inlineChatFocused && !notebookCellExecuting && notebookCellType == 'code' || notebookCellListFocused && !inlineChatFocused && !notebookCellExecuting && notebookCellType == 'code' && notebookKernelCount > 0 || notebookCellListFocused && !inlineChatFocused && !notebookCellExecuting && notebookCellType == 'code' && notebookKernelSourceCount > 0"
},
{
  "key": "shift+enter",
  "command": "notebook.cell.executeAndSelectBelow",
  "when": "notebookCellListFocused && !interactiveEditorFocused && notebookCellType == 'code' || editorTextFocus && inputFocus && notebookEditorFocused && !interactiveEditorFocused"
},
{
  "key": "shift+enter",
  "command": "interactive.execute",
  "when": "!notebookKernel && activeEditor == 'workbench.editor.interactive' || activeEditor == 'workbench.editor.interactive' && notebookKernel =~ /^ms-toolsai.jupyter\\//"
}
  • macOS TBD

@kasecato kasecato modified the milestones: v1.5.9, v1.6.1 Mar 20, 2024
@kasecato
Copy link
Owner

I'll disable editor.action.insertLineAfter when we editing a jupyter notebook

kasecato added a commit that referenced this issue Mar 23, 2024
Fixed #281 disabled insertLineAfter when notebook
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

3 participants