Comments (6)
@goerz do you have any thoughts here?
from jupytext.vim.
Hello @goerz , @BlueDrink9. I am not an advanced VIM user, but maybe I can contribute my own experience with this.
I use paired notebooks (py/ipynb), and open them simultaneously in Jupyter (ipynb) and in my text editor (py file, in PyCharm Pro). Conflicts do occur, either because of the autosave, or because I have changed the notebook in both Jupyter and my text editor. In this situation, Jupyter and the editor both tell me that the file has changed on disk, and give me the option to reload or overwrite. Most of the time I am happy with overriding the notebook with one of the two versions. But sometimes I prefer to merge the two edits, and here I find PyCharm very convenient, as it lets me compare the two different version of the .py file (in memory vs on disk), and merge them.
Would that work in VIM as well? Do you need something else than paired notebooks (i.e. jupytext --set-formats ipynb,py notebook.ipynb
)?
from jupytext.vim.
The problem is not that they become out of sync. This plugin opens a buffer called [].ipynb
, but fills it with the translated content. The write command that this plugin uses to then translate it back to the ipynb format in the file doesn't always replace the default vim write command, meaning the ipynb file sometimes ends up as a plaintext file, rather than a valid json.
from jupytext.vim.
Are you able to reproduce a situation where the plain text ends up being written to the ipynb file? I think I’ve had that happen once or twice, but wasn’t able to determine the cause.
from jupytext.vim.
@mwouts To be clear: I think if you actually have linked notebooks in a directory, it’s best not to use the jupytext.vim plugin and to just open the actual py or md file in vim. I don’t have much experience with this, though, as I haven’t really used linked notebooks so far.
from jupytext.vim.
I think this is one of the things causing it.
function! Autosave()
" Don't autosave if there is no buffer name.
if bufname('%') != '' && &ro != 1 && &modifiable == 1
" Automatically save before commands like :next and :make
set autowrite
" If no changes, don't touch modified timestamp.
silent! update
endif
endfunction
au! FocusLost,InsertLeave,BufLeave * call Autosave()
from jupytext.vim.
Related Issues (18)
- Fails for notebooks with spaces in filename HOT 2
- Linting with ALE not working HOT 1
- Error with format R (with CAPS)
- Name vim buffer with the jupytext_filename (foo.py) not with the original filename (foo.ipynb) HOT 1
- Auto-reload current file in Jupyter Notebook? HOT 4
- Detect notebook language HOT 3
- g:jupytext_fmt = 'md:myst' doesn't work HOT 2
- Cell title is not saved
- Jupytext plugin works but displays an error message when vimrc is empty HOT 1
- Can we make this work with vim's DiffOrig command?
- Cannot open .ipynb without .md file
- file type changed from python to json when starting editing
- Unable to delete temp files on Windows
- Create a blank ipynb notebook from vim-templates HOT 2
- Incompatible with fugitive, git-gutter, and git-signify HOT 4
- No syntax highlighting HOT 6
- Can I use jupytext to convert Rmd to ipynb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupytext.vim.