File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ tmux split and this allow to execute a file chunk-by-chunk.
1212This is somewhat similar to the code block execution that can be found in
1313scientific software (for example Matlab).
1414
15+ Keys mapping
16+ -----------
17+ By default, the following mappings are enabled :
18+
19+ * <C-c > will paste and execute the currently selected block in ipython
20+ * <C-b > will execute the current cell in ipython
21+ A cell is similar to MATLAB's cell and is defined as the line ranging from
22+ the previous ## to the next ##
23+
1524Difference with vim-ipython
1625---------------------------
1726Note that if you want more advanced integration with IPython (using the new
Original file line number Diff line number Diff line change @@ -60,3 +60,16 @@ endpython
6060
6161vmap <silent> <C-c> :python run_tmux_python_chunk()<CR>
6262
63+ " This is to emulate MATLAB's cell mode
64+ " Cells are delimited by ##. Note that there should be a ## at the end of the
65+ " file
66+ " The :?##?;/##/ part creates a range with the following
67+ " ?##? search backwards for ##
68+ " Then ';' starts the range from the result of the previous search (##)
69+ " /##/ End the range at the next ##
70+ " See the doce on 'ex ranges' here :
71+ " http://tnerual.eriogerg.free.fr/vimqrc.html
72+ " Then, we simply call run_tmux_python_chunk that will run the range
73+ " of the current buffer
74+ noremap <silent> <C-b> :?##?;/##/ :python run_tmux_python_chunk()<CR>
75+
You can’t perform that action at this time.
0 commit comments