mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-24 14:20:54 +08:00
Add Accel Enter
shortcut to execute a cell
This commit is contained in:
parent
7fed468576
commit
ef77a113ce
@ -223,6 +223,28 @@ const kernelStatus: JupyterFrontEndPlugin<void> = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A plugin to add an extra shortcut to execute a cell in place via Cmd-Enter on Mac.
|
||||
* TODO: switch to settings define menus when fixed upstream: https://github.com/jupyterlab/jupyterlab/issues/11754
|
||||
*/
|
||||
const runShortcut: JupyterFrontEndPlugin<void> = {
|
||||
id: '@retrolab/notebook-extension:run-shortcut',
|
||||
autoStart: true,
|
||||
activate: (app: JupyterFrontEnd) => {
|
||||
app.commands.addKeyBinding({
|
||||
command: 'notebook:run-cell',
|
||||
keys: ['Accel Enter'],
|
||||
selector: '.jp-Notebook:focus'
|
||||
});
|
||||
|
||||
app.commands.addKeyBinding({
|
||||
command: 'notebook:run-cell',
|
||||
keys: ['Accel Enter'],
|
||||
selector: '.jp-Notebook.jp-mod-editMode'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A plugin to enable scrolling for outputs by default.
|
||||
* Mimic the logic from the classic notebook, as found here:
|
||||
@ -319,6 +341,7 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
|
||||
checkpoints,
|
||||
kernelLogo,
|
||||
kernelStatus,
|
||||
runShortcut,
|
||||
scrollOutput
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user