🧙 Implement Rootiest Module
- Major Update!!! - Implements a rootiest module - Consolidates much of the settings - Improves usability and efficiency - Faster Loading - Cleaner Structure - More keymaps and plugins now have conditional loading
This commit is contained in:
@@ -91,20 +91,23 @@ return {
|
||||
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 function is_useimage_enabled()
|
||||
local useimage_file = vim.fn.stdpath("config") .. "/.useimage"
|
||||
local content = vim.fn.readfile(useimage_file)[1] or ""
|
||||
content = content:lower():gsub("%s+", "") -- convert to lowercase and remove whitespace
|
||||
local enable_values = { ["true"] = true, ["1"] = true, ["yes"] = true }
|
||||
|
||||
if enable_values[content] then
|
||||
local wterm = os.getenv("TERM_PROGRAM")
|
||||
local kterm = os.getenv("TERM") or ""
|
||||
local kit = string.find(kterm, "kitty")
|
||||
if wterm and string.find(wterm, "WezTerm") then
|
||||
if wterm and wterm:find("WezTerm") then
|
||||
return true -- Using WezTerm
|
||||
else
|
||||
return kit ~= nil -- Using Kitty
|
||||
return kterm:find("kitty") ~= nil -- Using Kitty
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user