Skip to content

Instantly share code, notes, and snippets.

@suiluj
Last active December 29, 2023 14:33
Show Gist options
  • Save suiluj/31a120258908f61575140eae04a990dd to your computer and use it in GitHub Desktop.
Save suiluj/31a120258908f61575140eae04a990dd to your computer and use it in GitHub Desktop.
[JupyterLab Shortcuts] Restart Kernel and run all cells - Run selected cell and below #jupyterlab #jupyter
{
"shortcuts": [
{
"command": "runmenu:restart-and-run-all",
"keys": [
"Shift Backspace"
],
"selector": "[data-jp-code-runner]"
},
{
"command": "notebook:run-all-below",
"keys": [
"Shift D"
],
"selector": ".jp-Notebook:focus"
}
]
}
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+[Semicolon]",
"command": "workbench.action.terminal.new"
},
{
"key": "cmd+[Backslash]",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+cmd+7",
"command": "-editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+backspace",
"command": "jupyter.restartkernelandrunallcells",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "shift+d",
"command": "notebook.cell.executeCellAndBelow",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "ctrl+shift+backspace",
"command": "notebook.clearAllCellsOutputs",
"when": "notebookEditorFocused && !inputFocus"
}
]
@suiluj
Copy link
Author

suiluj commented Aug 11, 2019

In JupyterLab: Settings -> Advanced Settings Editor -> Keyboard Shortcuts

shortcuts key is important (changed since beta versions of jupyterlab):
jupyterlab/jupyterlab#6865 (comment)

in vscode:

ctrl + p (command mode)

Search for: "Preferences: Open Keyboard Shortcuts (JSON)

paste json in user keybindings.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment