diff --git a/nvim/.config/nvim/lua/plugins/data_analysis.lua b/nvim/.config/nvim/lua/plugins/data_analysis.lua index 96e8823..071ae15 100644 --- a/nvim/.config/nvim/lua/plugins/data_analysis.lua +++ b/nvim/.config/nvim/lua/plugins/data_analysis.lua @@ -86,15 +86,21 @@ return { vim.g.molten_image_provider = "image.nvim" end - vim.keymap.set("n", "pi", function() - for k, v in pairs(opts.integrations) do - if v["only_render_image_at_cursor"] ~= nil then - v["only_render_image_at_cursor"] = not v["only_render_image_at_cursor"] + local prev_img_everywhere = function(state) + for _, integ in pairs(opts.integrations) do + if integ["only_render_image_at_cursor"] ~= nil then + integ["only_render_image_at_cursor"] = not state end - print(k, v) end require("image").setup(opts) - end, { desc = "toggle image rendering", silent = true }) + end + + vim.keymap.set("n", "]sp", function() + prev_img_everywhere(true) + end, { desc = "preview images everywhere", silent = true }) + vim.keymap.set("n", "[sp", function() + prev_img_everywhere(false) + end, { desc = "preview images at cursor", silent = true }) end, ft = { "markdown", "vimwiki", "quarto", "norg", "typst", "python" }, priority = 60,