Jupyter frontend for literate python files.
-
No external dependencies
-
Multiple kernel support
-
Visual range execution
- ntangle-inc.nvim
- Jupyter notebook (
jupyter lab
is recommended)
Warning
Full support only for ntangle v2 (*py.t2
files)
vim.api.nvim_create_autocmd({"BufRead", "BufNew"}, {
pattern = { "*.py.t2" },
callback = function(ev)
local opts = { buffer = ev.buf, silent=true }
vim.keymap.set("n", "<leader>r", function()
require"ntangle-notebook".send_ntangle_v2()
end, opts)
vim.keymap.set('v', '<leader>r', ":SendNTangleV2<CR>", opts)
end
})
Set the runtime directory. It can be found by running jupyter --runtime-dir
or python -m jupyter --runtime-dir
.
vim.g.ntangle_notebook_runtime_dir = "..."
-
Start jupyter and open a console
-
Right-click anywhere in console > Show All Kernel Activity
-
Execute
:lua require"ntangle-notebook".connect()
-
Choose a kernel if multiple are proposed
-
Open a
*.py.t2
file and execute code by:- In normal mode: Press
<leader>r
. - In visual mode: Select a region and
<leader>r
.
- In normal mode: Press