Is it possible to make a VIM plugin to view and edit Jupyter notebooks?
When somebody sends me a Jupyter notebook, I always dread opening up my browser to view it. A much simpler solution would be to just open it from VIM without launching a browser. Instead of displaying the graphics inside the VIM editors, a separate window could be opened to display the results of a graphics calculation, just like in the REPL. Text results would be displayed in VIM.
This is something I don’t have the knowledge, skills, or time for, but maybe someone else might.
If you’re willing to give emacs with evil for vi-emulation a chance, emacs-ipython-notebook is an alternative frontend to jupyter notebooks (originally by the Julia community’s own tkf). I haven’t used it in a year or so, and when I did the support for languages other than python was buggy at best, but it looks like significant development has gone into making it more general since then.
open the converted Notebook and connect to the qt console in vim with
:JupyterConnect
You can then run a cell, delimited by lines starting with ##, with <localleader> X.
Unfortunately converting the notebook with --to script doesn’t conserver the cell delimiters like the --to python option does for python.
The jupyter-vim plugin does not provide a lot of keybindings for the jupyter-workflow (run and jump to next cell, delete cell, jump to next/previous cell) but these should be not to difficult to come up with.
Edit:
After reading ihnortons answer I found converting the notebook with jupytext:
jupytext --to .jl:percent notebook.ipynb
Will leave the cell structure intact, so it can easily be used with jupyer-vim.
There is a new plugin for Neovim that people may be interested. It uses Selenium browser automation to fully synchronise vim to Jupyter Notebook. It will automatically open a Jupyter Notebook server and Firefox so you can view and edit ipynb directly from vim.