Add Image support

- Optional, only in compatible terminals
- change the value in .useimage to 'false' to disable
This commit is contained in:
2024-07-18 11:51:22 -04:00
parent 5705b6a414
commit 6f291c16e6
3 changed files with 33 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
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"
-- lazy snippet
return {
"3rd/image.nvim",
config = function()
require("image").setup()
end,
cond = function()
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.useimage") == 1 then
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.useimage")[1]
== "true"
then
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
end
end
end,
}