Repository navigation
jupynvim v0.4.6
Everything from v0.4.6-beta.1, plus output views and fixes that came out of the beta. If you ran the beta, the new parts are right below.
Updating
lazy.nvim users who follow main, which is what the README's spec does, get it with the next :Lazy update, and the matching backend downloads on the first notebook you open. With vim.pack, version = vim.version.range("*") picks it up. mini.deps users can pin checkout = "v0.4.6".
The first time you open a notebook that has a long, cut output, its undo history from before the update isn't read back, because the cut output's text changed. Notebooks without a cut output keep theirs.
Since the beta
- Hide a cell's whole output, plots included, with
<leader>nO(#37). One line like⋯ output hidden (1 image)takes its place, it stays hidden when the cell runs again and after a save, and the .ipynb never changes. - A long output shows its first
max_output_lineslines, 500 by default, and its last 5, with a marker such as⋯ 495 lines hidden (1000 total)between them. It used to show a quarter from the top and the rest from the bottom, and the counts were off by one.<leader>nlasks how many lines one cell shows, and<leader>nothen toggles between that and every line. <leader>nosays "nothing to expand" when nothing is cut, instead of claiming it expanded a plot (#37). Expanding no longer marks the notebook modified, so:qjust quits, and saving with an output expanded no longer loses the undo history on the next open. The key hint after the marker follows your keymaps.image_renderer = "chafa"draws code-cell images in terminals without Kitty graphics, like Windows Terminal (#38, thanks @leolaurindo).- A quick re-run whose output has the same length no longer shows the previous run's text (#41, thanks @ClaytonMcCray).
- Keys that act on a cell, like
<S-CR>, pick the cell you see while an output is still arriving or after:undo N. - Two copies of one notebook open at once no longer share expanded state or images.
Editing can no longer break a cell
Backspace at the start of a cell, J or Delete at its end, and dj or dG across the boundary merged two cells, and the next :w saved one cell's code under another's id or dropped a cell. Those edits are taken back now, so Backspace at a cell's start does nothing, the way it does in VS Code. Text typed along with them, by . or a macro, is kept. A cell you empty keeps one line to type on, a line moved under an output stays in its cell, and a :s that matches the separator text keeps the rest of its changes.
Undo inside a cell means your edit
u undoes your last edit, not the output a run wrote, and the output stays on screen. Output streaming in while you type no longer ends up in your undo steps, and a long, chatty run no longer pushes your own edits out of the undo history. :undo N and :earlier land exactly where you send them. Undo inside a cell stops at the last cell added, deleted or moved, and u in command mode undoes those. Undo history survives a reopen and :e!.
Moving between cells while editing (#27)
]c and [c move to the next or previous cell and keep you editing. A search, a diagnostic jump or a click that lands in another cell moves the editing there. <leader>nc and the run keys used from a cell's output act on that cell, not the one below.
Several images in one cell (#34)
Every image a cell outputs is shown, stacked in order. clear_output(wait=True) animations replace their frame instead of stacking it, and display(..., display_id=True) handles update in place. Saving an image asks which one when a cell has several, and SVG can be saved.
Language servers (#32)
Reopening a Julia notebook no longer attaches pyright. The kernel's language decides the filetype and whether Python-only setup runs. Each notebook gets its own pyright and keeps it across reopens instead of starting another every time, and an idle pyright left by a .py file is never taken over.
Installing without lazy.nvim (#33)
The backend installs itself on the first notebook you open, with vim.pack, mini.deps or a plain clone. It downloads the release that matches the plugin, checks its SHA256 and makes sure it runs on your machine before installing it. Set auto_install = false to turn that off. :JupynvimInstall installs or reinstalls it by hand, and :checkhealth jupynvim shows what it found. The Linux binary is statically linked now, so it runs on older distributions and HPC login nodes, where the previous one needed glibc 2.39. The README has vim.pack and mini.deps examples.
Also
- Keymap overrides can set their mode, as in
run_advance = { lhs = "<leader>r", mode = "n" }(#31, thanks @ferant2406). An override that starts with a printable key, like a Space leader, no longer maps in insert mode. - Images whose base64 contains whitespace render (#35, thanks @linmjie).
bthenddtyped quickly, in a macro or through:normalact on the right cell.- A source line that reads exactly like jupynvim's cell separator no longer splits its cell on save.
- A click after opening a split lands in the cell you clicked, and
2<CR>while editing moves two lines. - Remote: a respawn after an expired job no longer brings back the slow re-probe, and replacing a backend no longer drops the new one from routing.
Known
u right after clearing outputs cannot bring them back, and says so.
Full Changelog: v0.4.5...v0.4.6