🧙 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:
+22
-15
@@ -22,12 +22,18 @@ return {
|
||||
{ -- Wakatime
|
||||
"wakatime/vim-wakatime",
|
||||
cond = function()
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.wakatime")[1]
|
||||
== "true"
|
||||
then
|
||||
return true
|
||||
local function is_wakatime_enabled()
|
||||
local wakatime_file = vim.fn.stdpath("config") .. "/.wakatime"
|
||||
local content = vim.fn.readfile(wakatime_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
|
||||
return { enabled = true }
|
||||
else
|
||||
return { enabled = false }
|
||||
end
|
||||
end
|
||||
return is_wakatime_enabled()
|
||||
end,
|
||||
},
|
||||
{ -- Link following
|
||||
@@ -43,9 +49,6 @@ return {
|
||||
{ -- Auto-save
|
||||
"Pocco81/auto-save.nvim",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("auto-save").setup({})
|
||||
end,
|
||||
},
|
||||
{ -- User is bored
|
||||
"mikesmithgh/ugbi",
|
||||
@@ -126,14 +129,18 @@ return {
|
||||
"m4xshen/hardtime.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
||||
opts = function()
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.hardtime")[1]
|
||||
== "true"
|
||||
then
|
||||
return { enabled = true }
|
||||
else
|
||||
return { enabled = false }
|
||||
local function is_hardtime_enabled()
|
||||
local hardtime_file = vim.fn.stdpath("config") .. "/.hardtime"
|
||||
local content = vim.fn.readfile(hardtime_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
|
||||
return { enabled = true }
|
||||
else
|
||||
return { enabled = false }
|
||||
end
|
||||
end
|
||||
return is_hardtime_enabled()
|
||||
end,
|
||||
},
|
||||
{ -- GitLinker
|
||||
|
||||
Reference in New Issue
Block a user