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

[Help] Cannot configure Molten #203

Closed
teimurlu opened this issue Jun 4, 2024 · 3 comments
Closed

[Help] Cannot configure Molten #203

teimurlu opened this issue Jun 4, 2024 · 3 comments

Comments

@teimurlu
Copy link

teimurlu commented Jun 4, 2024

Setting up the plugin image.nvim produced the following error:

image.nvim: magick rock not found, please install it and restart your editor. Error: "module 'magick' not found

Also using Quarto complains about code runner not being initialised

Finally Molten cannot find cells.

I am new to neovim and using lazy.nvim. Below are my plugin.lua files.

molten-nvim.lua:

return {
  {
    "benlubas/molten-nvim",
    version = "^1.0.0", -- use version <2.0.0 to avoid breaking changes
    build = ":UpdateRemotePlugins",
    init = function()
      -- Configuration options
      vim.g.molten_output_win_max_height = 12
      vim.g.molten_auto_open_output = false
      vim.g.molten_image_provider = "image.nvim"
      vim.g.molten_wrap_output = true
      vim.g.molten_virt_text_output = true
      vim.g.molten_virt_lines_off_by_1 = true

      -- Key mappings
      vim.keymap.set("n", "<leader>mi", ":MoltenInit<CR>", { silent = true, desc = "Initialize Molten" })
      vim.keymap.set(
        "n",
        "<leader>me",
        ":MoltenEvaluateOperator<CR>",
        { silent = true, desc = "Molten run operator selection" }
      )
      vim.keymap.set("n", "<leader>rl", ":MoltenEvaluateLine<CR>", { silent = true, desc = "Molten evaluate line" })
      vim.keymap.set(
        "n",
        "<leader>rr",
        ":MoltenReevaluateCell<CR>",
        { silent = true, desc = "Molten re-evaluate cell" }
      )
      vim.keymap.set(
        "v",
        "<leader>r",
        ":<C-u>MoltenEvaluateVisual<CR>gv",
        { silent = true, desc = "Molten evaluate visual selection" }
      )
      vim.keymap.set(
        "n",
        "<leader>mo",
        ":noautocmd MoltenEnterOutput<CR>",
        { silent = true, desc = "Molten enter output" }
      )
    end,
  },
  {
    -- see the image.nvim readme for more information about configuring this plugin
    "3rd/image.nvim",
    opts = {
      backend = "kitty", -- whatever backend you would like to use
      max_width = 100,
      max_height = 12,
      max_height_window_percentage = math.huge,
      max_width_window_percentage = math.huge,
      window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
      window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
    },
  },
}

jupytext.lua:

  return {
    "GCBallesteros/jupytext.nvim",
    config = function()
      require("jupytext").setup({
        custom_language_formatting = {
          python = {
            extension = "md",
            style = "markdown",
            force_ft = "markdown", -- you can set whatever filetype you want here
          },
        },
      })
    end,
    -- Depending on your nvim distro or config you may need to make the loading not lazy
    lazy = false,
}

quarto.lua

return {
  {
    "jmbuhr/otter.nvim",
    lazy = false,
  },
  {

    "quarto-dev/quarto-nvim", -- Replace with the correct repository if different
    ft = { "quarto", "markdown" },
    config = function()
      local runner = require("quarto.runner")

      -- Set up key mappings for quarto.runner
      vim.keymap.set("n", "<leader>rc", runner.run_cell, { desc = "run cell", silent = true })
      vim.keymap.set("n", "<leader>ra", runner.run_above, { desc = "run cell and above", silent = true })
      vim.keymap.set("n", "<leader>rA", runner.run_all, { desc = "run all cells", silent = true })
      -- vim.keymap.set("n", "<leader>rl", runner.run_line, { desc = "run line", silent = true })
      vim.keymap.set("v", "<leader>r", runner.run_range, { desc = "run visual range", silent = true })
      vim.keymap.set("n", "<leader>RA", function()
        runner.run_all(true)
      end, { desc = "run all cells of all languages", silent = true })
    end,
    lazy = false, -- Ensure the plugin is loaded immediately, or set to true if you prefer lazy loading
  },
}
@teimurlu teimurlu changed the title [Help] <Cannot configure Molten> [Help] Cannot configure Molten Jun 4, 2024
@benlubas
Copy link
Owner

benlubas commented Jun 4, 2024

This is an image.nvim error. Please refer to the image.nvim README. Specifically this part

@benlubas benlubas closed this as completed Jun 4, 2024
@teimurlu
Copy link
Author

teimurlu commented Jun 4, 2024

This is an image.nvim error. Please refer to the image.nvim README. Specifically this part

The image issue is fixed now, thank you for your help, I specifically used this link..

Could you help with the other issues? P.S running line by line works but running as a cell does not work.

@benlubas
Copy link
Owner

benlubas commented Jun 4, 2024

Also using Quarto complains about code runner not being initialised

You need to run :QuatoActivate probably

Finally Molten cannot find cells.

I assume you're using :MoltenEvaluateCell when a cell doesn't exist yet. Molten cell != markdown/quarto cell.

Molten cells are defined in the molten readme

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

2 participants