luk400 / vim-jukit

Jupyter-Notebook inspired Neovim/Vim Plugin
MIT License
587 stars 23 forks source link

send cells or multiple lines without filling the repl history #107

Open benkj opened 10 months ago

benkj commented 10 months ago

Hi, in my Julia programming workflow I actively use both the .ipynb file and the REPL. I have two issues with how cells and multiple lines are handled.

  1. after sending a "big cell" to the REPL, all lines are saved in the history. Then if I want to work with the REPL and use the command before the send, I have to go back as many times as the number of lines in the cell, which is annoying for big cells/selections.
  2. If there was an error in the middle on the cell, I'd get a cascade of errors and it is very difficult to understand where the error was coming from.

Because of these problems, when I was using vimcmdline, I had a custom map that saved the cell into a temporary file, and then send the command include(tmpfile) to the REPL. In this way I solved both problems, since only a single line was added to the history, and if an error was there the julia debugger was able to tell me the exact location in the temp file. It is still not ideal though, as I would like to jump from the j-th line in the tempfile where the error occurred to the corresponding line in the cell...

How am I suppose to deal with such problems in jukit? I could implement my workaround, but I can't fine anything line VimCmdLineSendCmd to send a custom command to the REPL. Better ideas?

benkj commented 10 months ago

actually I realized that everything works out of the box in ipython, where several commands are sent to the repl to initialize the %jukit_run stuff. I guess that Julia support is very preliminary then. Any plans for a full Julia support?