@@ -28,7 +28,7 @@ define([
2828 var handler = action . handler ;
2929 action . handler = function ( env , event ) {
3030 var cell = env . notebook . get_selected_cell ( ) ;
31- if ( cell && isInInsertMode ( cell . code_mirror ) ) {
31+ if ( cell && ( isInInsertMode ( cell . code_mirror ) ) ) {
3232 // CodeMirror is in InsertMode, prevent any Jupyter action in
3333 // InsertMode and let CodeMirror to do things
3434 return ;
@@ -49,6 +49,59 @@ define([
4949 }
5050 }
5151
52+ // vim-binding original actions (Insert mode)
53+ actions . register ( {
54+ 'help' : 'run cell, select below' ,
55+ 'handler' : function ( env , event ) {
56+ env . notebook . command_mode ( ) ;
57+ actions . call ( 'jupyter-notebook:run-cell-and-select-next' , event , env ) ;
58+ env . notebook . edit_mode ( ) ;
59+ }
60+ } , 'run-cell-and-select-next' , 'vim-binding' ) ;
61+
62+ actions . register ( {
63+ 'help' : 'run selected cells' ,
64+ 'handler' : function ( env , event ) {
65+ env . notebook . command_mode ( ) ;
66+ actions . call ( 'jupyter-notebook:run-cell' , event , env ) ;
67+ env . notebook . edit_mode ( ) ;
68+ }
69+ } , 'run-cell' , 'vim-binding' ) ;
70+
71+ actions . register ( {
72+ 'help' : 'run cell, insert below' ,
73+ 'handler' : function ( env , event ) {
74+ env . notebook . command_mode ( ) ;
75+ actions . call ( 'jupyter-notebook:run-cell-and-insert-below' , event , env ) ;
76+ env . notebook . edit_mode ( ) ;
77+ }
78+ } , 'run-cell-and-insert-below' , 'vim-binding' ) ;
79+
80+ actions . register ( {
81+ 'help' : 'run all cells' ,
82+ 'handler' : function ( env , event ) {
83+ env . notebook . command_mode ( ) ;
84+ actions . call ( 'jupyter-notebook:run-all-cells' , event , env ) ;
85+ env . notebook . edit_mode ( ) ;
86+ }
87+ } , 'run-all-cells' , 'vim-binding' ) ;
88+
89+ actions . register ( {
90+ 'handler' : function ( env , event ) {
91+ env . notebook . command_mode ( ) ;
92+ actions . call ( 'jupyter-notebook:run-all-cells-above' , event , env ) ;
93+ env . notebook . edit_mode ( ) ;
94+ }
95+ } , 'run-all-cells-above' , 'vim-binding' ) ;
96+
97+ actions . register ( {
98+ 'handler' : function ( env , event ) {
99+ env . notebook . command_mode ( ) ;
100+ actions . call ( 'jupyter-notebook:run-all-cells-below' , event , env ) ;
101+ env . notebook . edit_mode ( ) ;
102+ }
103+ } , 'run-all-cells-below' , 'vim-binding' ) ;
104+
52105 // vin-binding original actions (Command mode)
53106 actions . register ( {
54107 'help' : 'scroll notebook up' ,
0 commit comments