feat: added color remapping

dev-assets
Pocco81 3 years ago
parent 0b9e1e36fc
commit a336b62ca7

@ -0,0 +1,22 @@
local M = {}
local cs_remaps
function M.get_remaps()
return cs_remaps
end
function M.set_remaps(val)
cs_remaps = val
end
function M.get_color_scheme(cs)
local remaps = M.get_remaps()
if not (next(remaps) == nil) then
return vim.tbl_deep_extend("force", require("catppuccino.color_schemes." .. cs), remaps)
else
return require("catppuccino.color_schemes." .. cs)
end
end
return M

@ -182,11 +182,13 @@ local function get_integrations()
return final_integrations
end
function M.apply()
local theme = {}
function M.apply(cs)
_G.cpc = require("catppuccino.config").options
_G.cpt = require("catppuccino.color_schemes." .. cpc.colorscheme)
cs = cs or cpc.colorscheme
-- _G.cpt = require("catppuccino.color_schemes." .. cs)
_G.cpt = require("catppuccino.core.cs").get_color_scheme(cs)
local theme = {}
theme.base = get_base()
theme.plugins = get_integrations()

@ -15,8 +15,10 @@ function M.load()
end
end
function M.setup(custom_opts)
function M.setup(custom_opts, remaps)
remaps = remaps or {}
require("catppuccino.config").set_options(custom_opts)
require("catppuccino.core.cs").set_remaps(remaps)
end
return M

@ -2,11 +2,11 @@ local M = {}
local utils = require("catppuccino.utils.util")
function M.main(option)
function M.main(option, args)
option = option or "load"
if (option == "load") then
utils.load(require("catppuccino.core.mapper").apply())
utils.load(require("catppuccino.core.mapper").apply(args))
else
print("Catppuccino: Command was not recognized")
end

Loading…
Cancel
Save