This plugin connects Neovim to Jupyviv, allowing you to work with and run Jupyter Notebooks from the comfort of your favorite text editor. Refer to the main Jupyviv repository for general information.
- locally
- wherever you want to run computation (locally or on a different machine)
- install Jupyviv
- install the Jupyter Kernel for the language you need, e.g.
pip install ipykernelfor Python
Jupyviv exposes various commands to control it. All commands are bound to Lua
functions that can also be used, e.g. to set up key bindings. See
lua/jupyviv/init.lua for more information.
To start Jupyviv for an existing Notebook, run :JupyvivStart in a .ipynb
Notebook buffer. This will
- Open Vivify to render the Notebook
- Create two new files, a
.jupyviv.ipynband a.jupyviv.[x]file (where[x]depends on the language, e.g.pyfor Python). It's recommended to globally git-ignore both files, and you can personally fully ignore the.jupyviv.ipynbfile. - Make Neovim automatically switch to a new buffer with the
.jupyviv.[x]file. This file is a plain text version of the code in the Notebook and all Jupyviv functionality is bound to its buffer:- Saving the buffer will sync the code with the Notebook and refresh Vivify
- Closing the buffer (e.g.
:bd) will shut down Jupyviv
Running :JupyvivStart without any arguments manages the Jupyviv Agent
automatically. If you want to use a running agent instead, use :JupyvivStart agent=<address> to provide its address.
To create a new Notebook, you can run :JupyvivNew <path/to/file.ipynb>. Here
you have to either specify kernel=<name> to let Jupyviv know which kernel to
use for the automatically managed Agent, or agent=<address> to use a running
Agent.
In the Jupyviv buffer, you can run the following commands:
:JupyvivRunHereto run the code cell the cursor is currently in:JupyvivRunSelectionto run the code cell the cursor is currently in, or all cells within the selected area in visual mode:JupyvivRunAllto run all code cells:JupyvivInterruptKernelto keyboard interrupt the kernel (equivalent of pressing<ctrl>-con the Kernel'sstdin):JupyvivRestartKernelto stop immediately and restart the kernel:JupyvivKillto shut down Jupyviv:JupyvivClearExecutionto remove all outputs and execution counts:JupyvivEnumerateExecutionto enumerate all execution counts without modifying outputs