This repository was archived by the owner on Feb 16, 2023. It is now read-only.
File tree 1 file changed +23
-0
lines changed
packages/notebook-extension/src
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,28 @@ const kernelStatus: JupyterFrontEndPlugin<void> = {
223
223
}
224
224
} ;
225
225
226
+ /**
227
+ * A plugin to add an extra shortcut to execute a cell in place via Cmd-Enter on Mac.
228
+ * TODO: switch to settings define menus when fixed upstream: https://github.com/jupyterlab/jupyterlab/issues/11754
229
+ */
230
+ const runShortcut : JupyterFrontEndPlugin < void > = {
231
+ id : '@retrolab/notebook-extension:run-shortcut' ,
232
+ autoStart : true ,
233
+ activate : ( app : JupyterFrontEnd ) => {
234
+ app . commands . addKeyBinding ( {
235
+ command : 'notebook:run-cell' ,
236
+ keys : [ 'Accel Enter' ] ,
237
+ selector : '.jp-Notebook:focus'
238
+ } ) ;
239
+
240
+ app . commands . addKeyBinding ( {
241
+ command : 'notebook:run-cell' ,
242
+ keys : [ 'Accel Enter' ] ,
243
+ selector : '.jp-Notebook.jp-mod-editMode'
244
+ } ) ;
245
+ }
246
+ } ;
247
+
226
248
/**
227
249
* A plugin to enable scrolling for outputs by default.
228
250
* Mimic the logic from the classic notebook, as found here:
@@ -319,6 +341,7 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
319
341
checkpoints ,
320
342
kernelLogo ,
321
343
kernelStatus ,
344
+ runShortcut ,
322
345
scrollOutput
323
346
] ;
324
347
You can’t perform that action at this time.
0 commit comments