theme configuration
vague2k opened this issue · comments
let users configure themes from within the plugin, preferably without going back to their config
good feature... i was searching if that is possible
Hey there! I had been working on a personal theme manager till I migrated to huez. I was wondering if I could pitch in a proposal for this issue and maybe contribute to this?
Proposed setup
--- huez/init.lua
M.setup = function(user_opts)
--- after setting user_opts
config.load_theme_configs()
--- Before scheduling and loading current theme
end
--- huez/config.lua
---@class Huez.Config
---@field theme_config_dir? string
M.load_theme_config()
--- Loads all individual theme configurations set in the directory theme_config_dir
---@class Huez.ThemeConf
---@field set_theme fun(theme: string):boolean
local theme_conf = {}
---- The below table will contain a mapping from a theme name to the config
---@type table<string, Huez.ThemeConf>
M.themes = {}
end
--- This function will be called instead of vim.cmd.colorscheme to set the theme
---@param theme string
---@return boolean
M.set_theme = function (theme)
-- Check if set theme is defined for the theme.
-- If so, call set theme and return response
-- else call the default vim.cmd.colorscheme with theme to set
end
@cool-pants This seems promising, I like the idea of using a function to set the theme configuration on a per key basis. I'll take a look at it over the weekend
edit: if you'd like to fork it and work on it in the mean you are more than free to do so !
resolved as of #44