diff --git a/.useimage b/.useimage new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/.useimage @@ -0,0 +1 @@ +true diff --git a/README.md b/README.md index b0f4254..21ca5d0 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,10 @@ used to configure user options. This file defines whether the WakaTime plugin is enabled. The options are `true` or `false`. +- `.useimage` : **Enables Image plugin** + This file defines whether the Image plugin is enabled. + The options are `true` or `false`. + ## Features - Comfortable keybindings and IDE-like features diff --git a/lua/plugins/image.lua b/lua/plugins/image.lua new file mode 100644 index 0000000..5f27394 --- /dev/null +++ b/lua/plugins/image.lua @@ -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, +}