Jupyter notebooks in Neovim. Edit cells, run code, and view plots in your terminal.
Requires Neovim 0.12 or newer. Add this plugin spec to your lazy.nvim configuration:
return {
"WhiteHades/ipynb.nvim",
lazy = false,
opts = {},
}Run :Lazy sync, then :IpynbInstall and restart Neovim.
See installation details for system requirements and image setup.
Open nvim example.ipynb. Keys use Normal mode unless noted; <localleader> defaults to \.
| Keys | Action |
|---|---|
<localleader>n or :Ipynb |
Open notebook actions. |
<localleader>r or Ctrl+Enter |
Run cell. |
<localleader>r in Visual mode |
Run selection. |
Shift+Enter |
Run cell and move to the next code cell. |
<localleader>R |
Run all cells. |
<localleader>a |
Run cell and cells above. |
<localleader>b |
Add code cell below. |
<localleader>m |
Add Markdown cell below. |
<localleader>s |
Interrupt execution. |
<localleader>o |
Expand or collapse the current cell output. |
<localleader>O |
Close the expanded output. |
<localleader>x |
Open image or HTML output. |
<localleader>i |
Restart kernel and clear variables. |
j / k, Ctrl+D / Ctrl+U in output view |
Browse output. |
q or Esc in output view |
Return with full output anchored below its cell. |
<localleader>o in output view |
Collapse the current output. |
q or Esc in image viewer |
Close the image viewer. |
zo / zc |
Open / close metadata. |
i |
Edit cell and fences. |
:w |
Save with configured formatting and linting. |
Existing mappings take precedence. Modified Enter keys depend on your terminal.
Output appears in full up to 10,000 rows or 1,000,000 characters.
See configuration and saving for settings and standalone environments.
PyTorch can use CUDA in your project kernel; notebook code selects GPU or CPU.
Run :checkhealth ipynb to check setup or :IpynbInstall to repair it.
See Jupytext, format help, testing, credits, or report an issue.
