From 847f5e2ee937a4b6583ffbbf91bea02cd76500b8 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 4 Oct 2023 20:39:05 -0500 Subject: [PATCH] refactor(nvim): reinclude image.nvim Reverst 6d163b9 'refactor(nvim): remove image.nvim' --- .../nvim/lua/plugins/configs/image.lua | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dots/.config/nvim/lua/plugins/configs/image.lua diff --git a/dots/.config/nvim/lua/plugins/configs/image.lua b/dots/.config/nvim/lua/plugins/configs/image.lua new file mode 100644 index 00000000..78054565 --- /dev/null +++ b/dots/.config/nvim/lua/plugins/configs/image.lua @@ -0,0 +1,22 @@ +return { + { + "3rd/image.nvim", + build = function() + ---@type vim.SystemCompleted + local out = vim.system({ "luarocks", "--lua-version", "5.1", "--local", "install", "magick" }):wait() + if out.code ~= 0 then + error( + string.format( + "Failed to install `magick` luarock for image.nvim!\n---STDOUT---\n%s\n\n---STDERR---\n\n%s", out.stdout, + out.stderr), vim.log.levels.ERROR) + end + end, + ft = { "markdown", "norg" }, + config = function() + package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;" + package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;" + require("image").setup({}) + vim.cmd.edit() + end, + }, +}