🧙 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:
+5
-24
@@ -1,39 +1,25 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- --------------------------------- CODING ------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
local rootiest = require("config.rootiest")
|
||||
|
||||
return {
|
||||
{ -- Codeium
|
||||
import = "lazyvim.plugins.extras.coding.codeium",
|
||||
cond = function()
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
|
||||
== "codeium"
|
||||
then
|
||||
return true
|
||||
end
|
||||
return rootiest.using_aitool("codeium")
|
||||
end,
|
||||
},
|
||||
{ -- Copilot
|
||||
import = "lazyvim.plugins.extras.coding.copilot",
|
||||
cond = function()
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
|
||||
== "copilot"
|
||||
then
|
||||
return true
|
||||
end
|
||||
return rootiest.using_aitool("copilot")
|
||||
end,
|
||||
},
|
||||
{ -- Tabnine
|
||||
import = "lazyvim.plugins.extras.coding.tabnine",
|
||||
cond = function()
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
|
||||
== "tabnine"
|
||||
then
|
||||
return true
|
||||
end
|
||||
return rootiest.using_aitool("tabnine")
|
||||
end,
|
||||
},
|
||||
{ -- Minuet-AI
|
||||
@@ -43,12 +29,7 @@ return {
|
||||
require("minuet").setup({ provider = "openai" })
|
||||
end,
|
||||
cond = function()
|
||||
if
|
||||
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
|
||||
== "minuet"
|
||||
then
|
||||
return true
|
||||
end
|
||||
return rootiest.using_aitool("minuet")
|
||||
end,
|
||||
},
|
||||
{ -- Yanky
|
||||
|
||||
+90
-42
@@ -1,8 +1,16 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- --------------------------------- EDITOR ------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
local rootiest = require("config.rootiest")
|
||||
|
||||
return {
|
||||
{ -- Edgy
|
||||
import = "lazyvim.plugins.extras.ui.edgy",
|
||||
},
|
||||
{ -- Mini-animate
|
||||
import = "lazyvim.plugins.extras.ui.mini-animate",
|
||||
},
|
||||
|
||||
{ -- Aerial
|
||||
import = "lazyvim.plugins.extras.editor.aerial",
|
||||
},
|
||||
@@ -159,48 +167,8 @@ return {
|
||||
event = "InsertEnter",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("smoothcursor").setup({
|
||||
type = "default",
|
||||
cursor = "",
|
||||
texthl = "SmoothCursor",
|
||||
fancy = {
|
||||
enable = true, -- enable fancy mode
|
||||
head = { cursor = "" },
|
||||
body = {},
|
||||
tail = { false }, -- false to disable fancy tail
|
||||
},
|
||||
matrix = { -- Loaded when 'type' is set to "matrix"
|
||||
head = {
|
||||
cursor = require("smoothcursor.matrix_chars"),
|
||||
texthl = {
|
||||
"SmoothCursor",
|
||||
},
|
||||
},
|
||||
body = {
|
||||
length = 6, -- Specifies the length of the cursor body
|
||||
cursor = require("smoothcursor.matrix_chars"),
|
||||
texthl = {
|
||||
"SmoothCursorGreen",
|
||||
},
|
||||
},
|
||||
tail = {
|
||||
texthl = {
|
||||
"SmoothCursor",
|
||||
},
|
||||
},
|
||||
unstop = false,
|
||||
},
|
||||
autostart = true, -- Automatically start SmoothCursor
|
||||
always_redraw = true, -- Redraw the screen on each update
|
||||
flyin_effect = "bottom", -- Choose "bottom" or "top" for flying effect
|
||||
speed = 25, -- Max speed is 100 to stick with your current position
|
||||
intervals = 35, -- Update intervals in milliseconds
|
||||
priority = 10, -- Set marker priority
|
||||
timeout = 3000, -- Timeout for animations in milliseconds
|
||||
threshold = 3, -- Animate only if cursor moves more than this many lines
|
||||
max_threshold = 2000, -- If you move more than this many lines, don't animate (if `nil`, deactivate check)
|
||||
disable_float_win = false, -- Disable in floating windows
|
||||
})
|
||||
---@diagnostic disable-next-line: missing-parameter
|
||||
require("smoothcursor").setup()
|
||||
-- Define last cursor position icon
|
||||
vim.fn.sign_define("smoothcursor_n", { text = "" })
|
||||
vim.fn.sign_define("smoothcursor_v", { text = " " })
|
||||
@@ -210,4 +178,84 @@ return {
|
||||
vim.fn.sign_define("smoothcursor_R", { text = "" })
|
||||
end,
|
||||
},
|
||||
{ -- Hlchunk
|
||||
"shellRaining/hlchunk.nvim",
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
local cb = function()
|
||||
if vim.g.colors_name == "tokyonight" then
|
||||
return "#806d9c"
|
||||
elseif vim.g.colors_name:find("catppuccin") then
|
||||
local catpalette = require("catppuccin.palettes").get_palette()
|
||||
return catpalette.teal
|
||||
elseif vim.g.colors_name == "monochrome" or "github_dark" then
|
||||
return "#CCCCCC"
|
||||
elseif vim.g.colors_name == "gruvbox" then
|
||||
return "#a9b665"
|
||||
elseif vim.g.colors_name == "dracula" or "eldritch" then
|
||||
return "#50fa7b"
|
||||
elseif vim.g.colors_name == "onedark" or "nightfox" then
|
||||
return "#98C379"
|
||||
elseif vim.g.colors_name == "nord" then
|
||||
return "#81A1C1"
|
||||
elseif vim.g.colors_name == "kanagawa" then
|
||||
return "#73C8AD"
|
||||
elseif vim.g.colors_name == "everforest" then
|
||||
return "#8FBCBB"
|
||||
elseif vim.g.colors_name == "github_light" or "paper" then
|
||||
return "#3f3f5a"
|
||||
elseif vim.g.colors_name == "neofusion" then
|
||||
return "#420ADD"
|
||||
else
|
||||
return "#7581FF"
|
||||
end
|
||||
end
|
||||
local common_config = {
|
||||
chunk = {
|
||||
style = {
|
||||
{ fg = cb },
|
||||
},
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
use_treesitter = true,
|
||||
chars = {
|
||||
"․․",
|
||||
"⁚⁚",
|
||||
"⁖⁖",
|
||||
"⁘⁘",
|
||||
"⁙⁙",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
},
|
||||
},
|
||||
}
|
||||
if vim.o.background == "dark" then
|
||||
common_config.indent.style = {
|
||||
{ fg = "#434437" },
|
||||
{ fg = "#2f4440" },
|
||||
{ fg = "#433054" },
|
||||
{ fg = "#284251" },
|
||||
{ fg = "#3e4451" },
|
||||
{ fg = "#565c64" },
|
||||
{ fg = "#6b737f" },
|
||||
{ fg = "#848a91" },
|
||||
}
|
||||
else
|
||||
common_config.indent.style = {
|
||||
{ fg = "#d0b0b0" },
|
||||
{ fg = "#b0b0d0" },
|
||||
{ fg = "#b0d0b0" },
|
||||
{ fg = "#a0a0a0" },
|
||||
{ fg = "#c0c0c0" },
|
||||
{ fg = "#e0e0e0" },
|
||||
{ fg = "#f0f0f0" },
|
||||
{ fg = "#ffffff" },
|
||||
}
|
||||
end
|
||||
require("hlchunk").setup(common_config)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
+31
-1
@@ -1,8 +1,10 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- --------------------------------- THEMES ------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
local rootiest = require("config.rootiest")
|
||||
|
||||
return {
|
||||
-- ----------------------- Themes --------------------------
|
||||
{ -- Tokyonight
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false, -- Override
|
||||
@@ -10,7 +12,6 @@ return {
|
||||
{ -- Catppuccin
|
||||
"catppuccin/nvim",
|
||||
lazy = false, -- Override
|
||||
opts = { integrations = { grug_far = true } },
|
||||
},
|
||||
{ -- Ayu
|
||||
"Shatur/neovim-ayu",
|
||||
@@ -59,4 +60,33 @@ return {
|
||||
"zenbones-theme/zenbones.nvim",
|
||||
dependencies = { "rktjmp/lush.nvim" },
|
||||
},
|
||||
-- ---------------------- Utilities ------------------------
|
||||
{ -- Transparent
|
||||
"xiyaowong/transparent.nvim",
|
||||
lazy = true,
|
||||
config = true,
|
||||
},
|
||||
{ -- Auto Dark Mode
|
||||
"f-person/auto-dark-mode.nvim",
|
||||
lazy = true,
|
||||
opts = {
|
||||
update_interval = 2000,
|
||||
set_dark_mode = function()
|
||||
vim.o.background = "dark"
|
||||
vim.cmd.colorscheme(
|
||||
rootiest.colortheme or "catppuccin-frappe" or "tokyonight"
|
||||
)
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.o.background = "light"
|
||||
vim.cmd.colorscheme(
|
||||
rootiest.colortheme or "catppuccin-latte" or "tokyonight-day"
|
||||
)
|
||||
end,
|
||||
},
|
||||
cond = function() -- Not Using SSH
|
||||
local ssh = os.getenv("SSH_TTY") or false
|
||||
return not ssh
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
+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