Skip to content

About

a neovim plugin for editing jupyter ntoebooks

Resources

Stars

2 stars

Watchers

2 watching

Forks

Repository files navigation

foundry-nvim

WARNING: this plugin is under active development and is not intended for use by anyone

Foundry

foundry-nvim is a plugin for editing Jupyter Notebooks inspired by predecessors such as:

Installation

The plugin requires a Python environment with jupyter-client, nbformat, and ipykernel.

The plotting server also requres Flask.

lazy.nvim

{
    'n-sweep/foundry-nvim',
    ft = 'ipynb',
    config = function()
        require('foundry').setup({ ... })
    end,
}

packer.nvim

use {
    'n-sweep/foundry-nvim',
    config = function()
        require('foundry').setup({ ... })
    end,
}

vim-plug

Plug 'n-sweep/foundry-nvim'
lua require('foundry').setup({ ... })

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

Usercommands

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

About

a neovim plugin for editing jupyter ntoebooks

Resources

Stars

2 stars

Watchers

2 watching

Forks

Contributors

Languages