From 722a868549d34d6a6f7947ffd7152a4c7e772824 Mon Sep 17 00:00:00 2001 From: Tommaso Negri Date: Fri, 5 Dec 2025 18:22:32 +0100 Subject: [PATCH] Rename colorscheme to Voltage --- colors/mycolortheme.lua | 1 - colors/voltage.lua | 1 + .../highlights/editor.lua | 0 .../highlights/languages/ruby.lua | 0 .../highlights/plugins/blink.lua | 0 .../highlights/plugins/fzf.lua | 0 .../highlights/plugins/mini.lua | 0 .../highlights/plugins/netrw.lua | 0 .../highlights/syntax.lua | 0 .../highlights/treesitter.lua | 0 lua/{mycolortheme => voltage}/init.lua | 30 +++++++++++-------- tests/lua.lua | 2 +- 12 files changed, 20 insertions(+), 14 deletions(-) delete mode 100644 colors/mycolortheme.lua create mode 100644 colors/voltage.lua rename lua/{mycolortheme => voltage}/highlights/editor.lua (100%) rename lua/{mycolortheme => voltage}/highlights/languages/ruby.lua (100%) rename lua/{mycolortheme => voltage}/highlights/plugins/blink.lua (100%) rename lua/{mycolortheme => voltage}/highlights/plugins/fzf.lua (100%) rename lua/{mycolortheme => voltage}/highlights/plugins/mini.lua (100%) rename lua/{mycolortheme => voltage}/highlights/plugins/netrw.lua (100%) rename lua/{mycolortheme => voltage}/highlights/syntax.lua (100%) rename lua/{mycolortheme => voltage}/highlights/treesitter.lua (100%) rename lua/{mycolortheme => voltage}/init.lua (60%) diff --git a/colors/mycolortheme.lua b/colors/mycolortheme.lua deleted file mode 100644 index c298b0d..0000000 --- a/colors/mycolortheme.lua +++ /dev/null @@ -1 +0,0 @@ -require("mycolortheme").setup() diff --git a/colors/voltage.lua b/colors/voltage.lua new file mode 100644 index 0000000..3a66fe9 --- /dev/null +++ b/colors/voltage.lua @@ -0,0 +1 @@ +require("voltage").setup() diff --git a/lua/mycolortheme/highlights/editor.lua b/lua/voltage/highlights/editor.lua similarity index 100% rename from lua/mycolortheme/highlights/editor.lua rename to lua/voltage/highlights/editor.lua diff --git a/lua/mycolortheme/highlights/languages/ruby.lua b/lua/voltage/highlights/languages/ruby.lua similarity index 100% rename from lua/mycolortheme/highlights/languages/ruby.lua rename to lua/voltage/highlights/languages/ruby.lua diff --git a/lua/mycolortheme/highlights/plugins/blink.lua b/lua/voltage/highlights/plugins/blink.lua similarity index 100% rename from lua/mycolortheme/highlights/plugins/blink.lua rename to lua/voltage/highlights/plugins/blink.lua diff --git a/lua/mycolortheme/highlights/plugins/fzf.lua b/lua/voltage/highlights/plugins/fzf.lua similarity index 100% rename from lua/mycolortheme/highlights/plugins/fzf.lua rename to lua/voltage/highlights/plugins/fzf.lua diff --git a/lua/mycolortheme/highlights/plugins/mini.lua b/lua/voltage/highlights/plugins/mini.lua similarity index 100% rename from lua/mycolortheme/highlights/plugins/mini.lua rename to lua/voltage/highlights/plugins/mini.lua diff --git a/lua/mycolortheme/highlights/plugins/netrw.lua b/lua/voltage/highlights/plugins/netrw.lua similarity index 100% rename from lua/mycolortheme/highlights/plugins/netrw.lua rename to lua/voltage/highlights/plugins/netrw.lua diff --git a/lua/mycolortheme/highlights/syntax.lua b/lua/voltage/highlights/syntax.lua similarity index 100% rename from lua/mycolortheme/highlights/syntax.lua rename to lua/voltage/highlights/syntax.lua diff --git a/lua/mycolortheme/highlights/treesitter.lua b/lua/voltage/highlights/treesitter.lua similarity index 100% rename from lua/mycolortheme/highlights/treesitter.lua rename to lua/voltage/highlights/treesitter.lua diff --git a/lua/mycolortheme/init.lua b/lua/voltage/init.lua similarity index 60% rename from lua/mycolortheme/init.lua rename to lua/voltage/init.lua index 09a7783..6b70223 100644 --- a/lua/mycolortheme/init.lua +++ b/lua/voltage/init.lua @@ -1,11 +1,17 @@ local M = {} -function M.setup(config) +M.config = { + accent = "blue" +} + +function M.setup(opts) + M.config = vim.tbl_deep_extend("force", M.config, opts or {}) + vim.cmd("highlight clear") vim.cmd("syntax reset") - vim.o.background = config.style - vim.g.colors_name = "my color theme" + vim.o.background = "dark" + vim.g.colors_name = "voltage" local colors = { bg = nil, @@ -50,26 +56,26 @@ function M.setup(config) } for _, highlight in ipairs({ "editor", "syntax", "treesitter" }) do - local mod = require("mycolortheme.highlights." .. highlight) + local mod = require("voltage.highlights." .. highlight) - for group, opts in pairs(mod.setup(colors, config)) do - vim.api.nvim_set_hl(0, group, opts) + for group, group_opts in pairs(mod.setup(colors, M.config)) do + vim.api.nvim_set_hl(0, group, group_opts) end end for _, highlight in ipairs({ "ruby" }) do - local mod = require("mycolortheme.highlights.languages." .. highlight) + local mod = require("voltage.highlights.languages." .. highlight) - for group, opts in pairs(mod.setup(colors, config)) do - vim.api.nvim_set_hl(0, group, opts) + for group, group_opts in pairs(mod.setup(colors, M.config)) do + vim.api.nvim_set_hl(0, group, group_opts) end end for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini" }) do - local mod = require("mycolortheme.highlights.plugins." .. highlight) + local mod = require("voltage.highlights.plugins." .. highlight) - for group, opts in pairs(mod.setup(colors, config)) do - vim.api.nvim_set_hl(0, group, opts) + for group, group_opts in pairs(mod.setup(colors, M.config)) do + vim.api.nvim_set_hl(0, group, group_opts) end end end diff --git a/tests/lua.lua b/tests/lua.lua index 1c4ab1e..a2443a0 100644 --- a/tests/lua.lua +++ b/tests/lua.lua @@ -10,7 +10,7 @@ vim.pack.add({ }) require("plugins.alabaster") -require("plugins.mycolortheme") +require("plugins.voltage") require("plugins.mason") require("plugins.treesitter") require("plugins.fzf")