Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:IronRepl not editor command #385

Open
DILAWERRAHIM opened this issue Aug 2, 2024 · 4 comments
Open

:IronRepl not editor command #385

DILAWERRAHIM opened this issue Aug 2, 2024 · 4 comments

Comments

@DILAWERRAHIM
Copy link

{
"hkupty/iron.nvim",
config = function()
local iron = require("iron.core")

  iron.setup {
    config = {
      scratch_repl = true,
      repl_definition = {
        python = {
          command = { "python3" },
          format = require("iron.fts.common").bracketed_paste_python,
        },
        sh = {
          command = { "zsh" },
        },
      },
      repl_open_cmd = require("iron.view").split.vertical.botright(50),
    },
    keymaps = {
      send_motion = "<space>sc",
      visual_send = "<space>sc",
      send_file = "<space>sf",
      send_line = "<space>sl",
      send_paragraph = "<space>sp",
      send_until_cursor = "<space>su",
      send_mark = "<space>sm",
      mark_motion = "<space>mc",
      mark_visual = "<space>mc",
     remove_mark = "<space>md",
      cr = "<space>s<cr>",
      interrupt = "<space>s<space>",
      exit = "<space>sq",
      clear = "<space>cl",
    },
    highlight = {
      italic = true
    },
    ignore_blank_lines = true,
  }
@pchest
Copy link

pchest commented Sep 22, 2024

I'm experiencing the same issue. Did you find a solution?

@DILAWERRAHIM
Copy link
Author

no I can not

@DILAWERRAHIM
Copy link
Author

** this code work correctly **
{
'Vigemus/iron.nvim',
ft = { "python" }, -- Load only for these file types
config = function()
local iron = require("iron.core")

iron.setup({
  config = {
    scratch_repl = true, -- Allow discarding REPLs
    repl_definition = {
      python = { command = { "ipython" } }
    },
    repl_open_cmd = require("iron.view").right(vim.o.columns * 0.4), -- Dynamic width
  },
  keymaps = {
    send_motion = "<space>rc",
    visual_send = "<space>rc",
    send_file = "<space>rf",
    send_line = "<space>rl",
    send_mark = "<space>rm",
    mark_motion = "<space>rmc",
    mark_visual = "<space>rmc",
    remove_mark = "<space>rmd",
    cr = "<space>r<cr>",
    interrupt = "<space>r<space>",
    exit = "<space>rq",
    clear = "<space>rx",
    send_paragraph = "<space>rp", -- Custom keymap to send a paragraph
  },
  highlight = {
    italic = true,
    fg = "#A9A1E1", -- Optional custom foreground
    bg = "#2E3440", -- Optional custom background
  },
  ignore_blank_lines = true,
})

-- Additional keymaps for REPL management
vim.keymap.set("n", "<space>rs", "<cmd>IronRepl<cr>")
vim.keymap.set("n", "<space>rr", "<cmd>IronRestart<cr>")
vim.keymap.set("n", "<space>rF", "<cmd>IronFocus<cr>")
vim.keymap.set("n", "<space>rh", "<cmd>IronHide<cr>")
vim.keymap.set("n", "<space>rc", "<cmd>IronClear<cr>") -- Clear REPL

end,
},

@nickeisenberg
Copy link
Contributor

Did you mean to have 'hkupty/iron.nvim', instead of 'Vigemus/iron.nvim', in the original comment of this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants