feat: allow remaps of both the colorscheme and the hi groups

dev-doc
Pocco81 3 years ago
parent 498db617ae
commit 65aef85685

@ -1,17 +1,8 @@
local M = {}
local cs_remaps
function M.get_remaps()
return cs_remaps
end
function M.set_remaps(val)
cs_remaps = val
end
local remaps_mod = require("catppuccino.core.remaps")
function M.get_color_scheme(cs)
local remaps = M.get_remaps() or {}
local remaps = remaps_mod.get_cs_remaps() or {}
local good, color_scheme = pcall(require, "catppuccino.color_schemes." .. cs)
if not good then

@ -189,6 +189,7 @@ local function get_integrations()
end
end
final_integrations = vim.tbl_deep_extend("force", final_integrations, require("catppuccino.core.remaps").get_hig_remaps())
return final_integrations
end

@ -0,0 +1,22 @@
local M = {}
local cs_remaps -- colorscheme
local hig_remaps -- highlight groups
function M.get_cs_remaps()
return cs_remaps
end
function M.set_cs_remaps(val)
cs_remaps = val
end
function M.get_hig_remaps()
return hig_remaps
end
function M.set_hig_remaps(val)
hig_remaps = val
end
return M

@ -4,10 +4,18 @@ function M.load(args)
require("catppuccino.main").main("load", args)
end
function M.setup(custom_opts, remaps)
remaps = remaps or {}
function M.remap(colorscheme, hi_groups)
colorscheme = colorscheme or {}
hi_groups = hi_groups or {}
local remaps_mod = require("catppuccino.core.remaps")
remaps_mod.set_cs_remaps(colorscheme)
remaps_mod.set_hig_remaps(hi_groups)
end
function M.setup(custom_opts)
require("catppuccino.config").set_options(custom_opts)
require("catppuccino.core.cs").set_remaps(remaps)
end
return M

Loading…
Cancel
Save