Vim plugin for Jupyter notebooks?

One possibility is to use https://github.com/wmvanvliet/jupyter-vim.
You would have to convert the notebooks with

jupyter-nbconvert -to script Notebook.ipynb

Then you can open a jupyter-qtconsole with

jupyter-qtconsole --kernel=julia-1.2

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.

1 Like