@@ -175,6 +175,10 @@ class VimCell {
175175 } ) ;
176176 lvim . mapCommand ( '<C-e>' , 'action' , 'moveCellDown' , { } , { extra : 'normal' } ) ;
177177 lvim . mapCommand ( '<C-y>' , 'action' , 'moveCellUp' , { } , { extra : 'normal' } ) ;
178+ lvim . defineAction ( 'splitCell' , ( cm : any , actionArgs : any ) => {
179+ commands . execute ( 'notebook:split-cell-at-cursor' ) ;
180+ } ) ;
181+ lvim . mapCommand ( '-' , 'action' , 'splitCell' , { } , { extra : 'normal' } ) ;
178182 }
179183 }
180184
@@ -352,6 +356,18 @@ function activateCellVim(app: JupyterLab, tracker: INotebookTracker): Promise<vo
352356 } ,
353357 isEnabled
354358 } ) ;
359+ commands . addCommand ( 'center-cell' , {
360+ label : 'Center Cell' ,
361+ execute : args => {
362+ const current = getCurrent ( args ) ;
363+
364+ if ( current ) {
365+ let er = current . notebook . activeCell . inputArea . node . getBoundingClientRect ( ) ;
366+ current . notebook . scrollToPosition ( er . bottom , 0 ) ;
367+ }
368+ } ,
369+ isEnabled
370+ } ) ;
355371
356372 commands . addKeyBinding ( {
357373 selector : '.jp-Notebook.jp-mod-editMode' ,
@@ -529,6 +545,16 @@ function activateCellVim(app: JupyterLab, tracker: INotebookTracker): Promise<vo
529545 keys : [ 'Ctrl Y' ] ,
530546 command : 'notebook:move-cell-up'
531547 } ) ;
548+ commands . addKeyBinding ( {
549+ selector : '.jp-Notebook:focus' ,
550+ keys : [ 'Z' , 'Z' ] ,
551+ command : 'center-cell'
552+ } ) ;
553+ commands . addKeyBinding ( {
554+ selector : '.jp-Notebook.jp-mod-editMode' ,
555+ keys : [ 'Ctrl O' , 'Z' , 'Z' ] ,
556+ command : 'center-cell'
557+ } ) ;
532558
533559 // tslint:disable:no-unused-expression
534560 new VimCell ( app , tracker ) ;
0 commit comments