Vim plugin to interact with jupyter_ascending
Currently only supports Jupyter Notebook.
First, you must install jupyter_ascending in the python envirenment you're working in. For example:
$ pyenv activate my_notebook_env
$ pip install jupyter_ascending
It is possible you won't need to run the following commands on newer version of jupyter notebook, but it's recommended that you do anyway, because installing extensions is hard.
$ jupyter nbextension install --py --sys-prefix jupyter_ascending
$ jupyter nbextension enable jupyter_ascending --sys-prefix --py
$ jupyter serverextension enable jupyter_ascending --sys-prefix --py
You can confirm it's installed by checking:
$ jupyter nbextension list
$ jupyter serverextension list
Then install this plugin using the vim plugin manager you like. For example:
Plug 'untitled-ai/jupyter_ascending.vim'
- First create a Jupyter notebook notebook_name.sync.ipynb.
- Then generate a notebook_name.sync.py file using jupytext with "percent format". (see Paired notebooks in jupytext)
- Edit .sync.py file in vim and Jupyter Ascending will update the .sync.ipynb every time .sync.py is saved.
- Send commands to Jupyter notebook via the following mappings:
Execute cell
nmap <space><space>x <Plug>JupyterExecute
Execute all cells
nmap <space><space>X <Plug>JupyterExecuteAll
Use # %%
to separate cells.
See doc/jupyter_ascending.txt
for more information.