local env = require("my.helpers.env") local M = { "hkupty/iron.nvim", -- repl support cond = env.vscode.not_active(), cmd = "IronRepl", } function M.init() -- iron also has a list of commands, see :h iron-commands for all available commands vim.keymap.set("n", "iss", "IronRepl") vim.keymap.set("n", "ir", "IronRestart") vim.keymap.set("n", "if", "IronFocus") vim.keymap.set("n", "ih", "IronHide") local status, wk = pcall(require, "which-key") if status then wk.register({ ["i"] = { name = "[I]ron repl", s = { name = "[s]end" }, m = "[m]ark", }, }) end end function M.config() local iron = require("iron.core") iron.setup({ config = { -- Your repl definitions come here repl_definition = {}, -- How the repl window will be displayed -- See below for more information repl_open_cmd = require("iron.view").right(40), }, -- Iron doesn't set keymaps by default anymore. -- You can set them here or manually add keymaps to the functions in iron.core keymaps = { send_motion = "isc", visual_send = "is", send_file = "isf", send_line = "isl", send_mark = "ism", mark_motion = "imc", mark_visual = "imc", remove_mark = "imd", cr = "is", interrupt = "is", exit = "isq", clear = "isr", }, -- If the highlight is on, you can change how it looks -- For the available options, check nvim_set_hl highlight = { italic = true }, ignore_blank_lines = true, -- ignore blank lines when sending visual select lines }) end return M