summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/utilities.lua
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-07-30 21:36:10 -0400
committertriethyl <triethylammonium@pm.me>2025-07-30 21:36:10 -0400
commit168864226d2629279efed9630d0af8cae4c914b2 (patch)
tree1e578d299a02d5d8c1f06d604ee3ace014bc6457 /pkgs/custom-neovim/config/lua/utilities.lua
parent657ed8b8837fd7c0aee41f7a54ec2369c059a91b (diff)
neovim: working on custom ui
Diffstat (limited to 'pkgs/custom-neovim/config/lua/utilities.lua')
-rw-r--r--pkgs/custom-neovim/config/lua/utilities.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/custom-neovim/config/lua/utilities.lua b/pkgs/custom-neovim/config/lua/utilities.lua
index 77645ca..d2a26b6 100644
--- a/pkgs/custom-neovim/config/lua/utilities.lua
+++ b/pkgs/custom-neovim/config/lua/utilities.lua
@@ -32,3 +32,20 @@ Utils.generate_theme_from_highlight_groups = function()
background = get_highlight_colors("Normal").bg,
}
end
+
+Utils.link_highlight = function(first_highlight, second_highlight)
+ vim.cmd.highlight {bang = true, "link", first_highlight, second_highlight}
+end
+
+Utils.replaceInTable = function(t, str1, str2)
+ for key, value in pairs(t) do
+ if type(value) == "string" then
+ -- Replace <C-w> with <leader>w in the string
+ t[key] = value:gsub(str1, str2)
+ elseif type(value) == "table" then
+ -- Recursively process nested tables
+ Utils.replaceInTable(value, str1, str2)
+ end
+ end
+ return t
+end