To install Notebook Navigator, use the following lazy.nvim specification. It is recommended to map cell movement and execution to leader keys for quick access, while using the Hydra mode for more complex manipulations.
Note that this setup includes iron.nvim as the REPL provider and mini.comment for cell commenting. You can swap iron.nvim for toggleterm.nvim or molten-nvim depending on your preference.
{
"GCBallesteros/NotebookNavigator.nvim",
keys = {
{ "]h", function() require("notebook-navigator").move_cell "d" end },
{ "[h", function() require("notebook-navigator").move_cell "u" end },
{ "<leader>X", "<cmd>lua require('notebook-navigator').run_cell()<cr>" },
{ "<leader>x", "<cmd>lua require('notebook-navigator').run_and_move()<cr>" },
},
dependencies = {
"echasnovski/mini.comment",
"hkupty/iron.nvim", -- repl provider
-- "akinsho/toggleterm.nvim", -- alternative repl provider
-- "benlubas/molten-nvim", -- alternative repl provider
"anuvyklack/hydra.nvim",
},
event = "VeryLazy",
config = function()
local nn = require "notebook-navigator"
nn.setup({ activate_hydra_keys = "<leader>h" })
end,
}