Open mirbehroznoor opened 1 year ago
Thanks for the suggestions. Here are some questions and comments:
code-cells-eval-region-commands
)?Since I am using code-cells, I have rarely opened the Jupyter Notebook for analysis.
To your questions:
Run all cells Below/ Above: Should it include the current cell There are two ways to reason it.
code-cells-eval-buffer
or run all cells in the buffer.Run all Cells in the Buffer
.ipynb
files for graphs. There are always little tweaks to do. I simply edit the graph cell and evaluate the whole buffer..ipynb
file or in the side window. I can easily check the output if the whole file was smoothly evaluated or not.I have no idea what is upstream shell package.
If I understood it correctly, the multiple dispatch could be code-cells-eval-below
or code-cells-eval-above
. They would not be the same as code-cells-eval-buffer
.
I also think there should be other commands such as:
replace-string
replaces all the matches in the buffer instead of the one cell).This is my hydra for code-cells which keeps away the Jupyter Notebook from annoying me:
^Insert^ ^Insert^ ^Evaluate^ ^Move Cell^ ^Actions
^Cell^ ^Markdown^
^^^^^^^^--------------------------------------------------------------------------
_a_: Above _M_: Above _w_: Whole Buffer _<up>_: Up _D_: Delete
_b_: Below _m_: Below _A_: All Cells Above _<down>_: Down _c_: Comment
_i_: At Cursor ^ ^ _B_: All Cells Below ^ ^ _C_: Copy
^ ^ ^ ^ ^ ^ ^ ^ _-_: Break Cell
^ ^ ^ ^ ^ ^ ^ ^ _d_: Cut
Thank you and have a nice day!
Some of the cell manipulation commands would be really helpful, especially delete current cell. IIRC, break cell, insert cell below/above could just be built in terms of outline-minor-mode commands.
However, that last one, edit current cell in a temp buffer seems potentially quite useful.
Thanks for the package. It is amazingly lightweight and fantastic. I am glad to find it.
I felt it is missing functions like:
1) Evaluate Current cell block and move to the next. 2) Run all cells below. 3) Run all cells in the buffer. 4) Lastly, evaluate cell and ensure python shell is running.
Below are the functions for the particular purposes.
Code-cells-eval-and-step
Evaluate the current cell and move to the next block, just like in Jupyter notebook or Elpy (elpy-send-statement-and-step). I had simply added one-line (outline-next-heading) at the end of code-cells-eval.
Run all cells below
It is almost the same code as code-cells-eval-above.
Run all cells in the Buffer: Beginning to End
As in org-src-execute-buffer or Run all in jupyter-notebook. Again, he same code as code-cells-eval-above.
OR
Evaluate cell and ensure python shell is running.
I have been using code-cells with Elpy functions. I use Elpy function (elpy-shell--ensure-shell-running) with code-cells-eval-and-step. Simply open the file and evaluate the code. Elpy automatically starts or switch to the running Python session. The only trouble with this code and code-cells-eval-buffer, is the Elpy dependency (although not necessary but saves the trouble of starting the inferior python process).
I wanted to share these slight additions. Since, my Elisp knowledge is limited, I would be glad to know if there is another better way.
Thank you and have a nice day!
regards, Behroz