szymonmaszke / vimpyter

Edit your Jupyter notebooks in Vim/Neovim
MIT License
334 stars 17 forks source link

Use external notebook server instead of launching one #14

Closed tammersaleh closed 6 years ago

tammersaleh commented 6 years ago

Because of a complicated environment setup, we have to run our notebooks via a separate script. Is it possible to have vimpyter interact with an already-running notebook server, rather than launch its own via VimpyterStartJupyter?

tammersaleh commented 6 years ago

(btw, this plugin is already amazing)

szymonmaszke commented 6 years ago

Yeah, it should not be too complicated, I'll get into it this weekend, will post updates.

tammersaleh commented 6 years ago

Just realized that I might have misunderstood the notebook feature - does it run the notebook from vim and update the results, or does it just launch the notebook and open the browser? If the latter, then this might not be a useful feature request (I'm fine launching the notebook server myself and ⌘-tabbing between apps)

Either way, this plugin is still a life saver.

szymonmaszke commented 6 years ago

Well, if you have the .ipynb file locally you can edit it easily using vimpyter. Say you can run jupyter notebook using your script, afterwards open the .ipynb file using vim and refresh the notebook (website tab) after change. I'm not sure if that's what you meant.

I am not really into all jupyter notebook technicalities, so you would have to describe it in more detail (either here or via e-mail) if this doesn't fit your case.

tammersaleh commented 6 years ago

Yep, my current workflow is:

  1. start jupyter notebooks
  2. edit the .ipynb file in vim (via vimpyter)
  3. save my changes
  4. switch over to the browser
  5. reload the notebook there
  6. click around to run the cell I changed
  7. switch back to vim (and possibly reload the file to collect any changes made in the browser)

I was hoping vimpyter had a feature where I could somehow run the current cell from within vim without the back and forth, and I mistook the VimpyterStartJupyter command as being part of that feature. I'm happy to close this issue out, as I don't mind running the script outside of vim - it was the rest of the back and forth I was hoping to avoid.

szymonmaszke commented 6 years ago

Back and forth could be avoided using automatic website reloading after notebook saving. Unluckily I am not into those things (maybe selenium could work?) and would require some help from people way more skillful in this domain than me.