WARNING: this plugin is under active development and is not intended for use by anyone
foundry-nvim is a plugin for editing Jupyter Notebooks inspired by predecessors such as:
The plugin requires a Python environment with jupyter-client, nbformat, and ipykernel.
The plotting server also requres Flask.
{
'n-sweep/foundry-nvim',
ft = 'ipynb',
config = function()
require('foundry').setup({ ... })
end,
}use {
'n-sweep/foundry-nvim',
config = function()
require('foundry').setup({ ... })
end,
}Plug 'n-sweep/foundry-nvim'
lua require('foundry').setup({ ... })To set your desired keymaps, pass a function with an argument ev to foundry's setup() like so, ensuring your keymaps are tied only to your notebook buffer.
local func = function(ev)
vim.keymap.set({'n', 'v'}, '<leader>fe', ":FoundryExecute<CR>", {
desc = 'Foundry execute the current cell',
buffer = ev.buf,
silent = true,
})
vim.keymap.set(...)
end
require('foundry').setup({keymap_func = func})| Command | Description |
|---|---|
FoundryExecute |
Execute the cell under the cursor |
FoundryExecuteStep |
Execute the cell under the cursor and step forward |
FoundryOpen |
Open cell output in a floating window |
FoundryDelete |
Delete the cell under the cursor |
FoundryCreateCell |
Create a new code cell below the current cell |
FoundryCreateCellAbove |
Create a new code cell above the current cell |
FoundryCreateMdCell |
Create a new markdown cell below the current cell |
FoundryCreateMdCellAbove |
Create a new markdown cell above the current cell |
FoundryNext |
Move cursor to the next cell |
FoundryPrev |
Move cursor to the previous cell |
FoundryStep {n} |
Move cursor n cells (negative = backward) |
FoundryYankOutput |
Yank the output of the current cell |
FoundryYankInput |
Yank the input of the current cell |
FoundryMoveUp |
Move the current cell up |
FoundryMoveDown |
Move the current cell down |
FoundryMove {n} |
Move the current cell n positions |
FoundryShutdown |
Shut down the kernel manager |
FoundryInfo |
Print kernel info |
