Skip to content

jbyuki/ntangle-notebook.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntangle-notebook.nvim

Jupyter frontend for literate python files.

Main Features

  • No external dependencies

  • Multiple kernel support

  • Visual range execution

Requirements

Warning

Full support only for ntangle v2 (*py.t2 files)

Configuration

Keybindings

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
})

Runtime dir

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 = "..."

Usage

  • 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.

Releases

No releases published

Packages

No packages published

Languages