goerz / jupytext.vim

Vim plugin for editing Jupyter ipynb files via jupytext

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Name vim buffer with the jupytext_filename (foo.py) not with the original filename (foo.ipynb)

phcerdan opened this issue · comments

I love this plugin, using it quite often, however I find it failing for plugins (LSP servers) that need/use files on disk (not vim buffers).

I think when opening an ipynb file, the name of the vim buffer (foo.ipynb) is misleading, I am not editing the original .ipynb file, but the converted plain file .py.
Is there an option to rename the vim buffer to foo.py? The automatic write back to the ipynb is great, as well as deleting the py file if I opened a .ipynb.

You might be better off using the actual jupytext, where the jupyter server manages linked .py and .ipynb files, and you can edit the .py files directly. Or, manually convert .ipynb to .py, edit the .py, and then convert back. With this plugin, my mindset is that I'm actually editing the .ipynb file, I just want it to display as code. Hence, I want the buffer to be ipynb.

I'm aware that this breaks some other plugins that are looking at the contents of the file on disk in the background (see #5). If I can find some ways to mitigate that without making things too convoluted, I may, but I don't want to stray too far from the basic philosophy of the plugin, even though I appreciate the suggestion. This is just supposed to be a "quick end dirty" method for modifying ipynb files outside of a running jupyter server.