feat: fixed & added mappings & users can now add their custom "mode_opt"

This commit is contained in:
Leon Heidelbach 2022-05-12 22:13:00 +02:00 committed by siduck
parent 63651e90e6
commit c7a4d4e337
2 changed files with 23 additions and 6 deletions

View file

@ -61,9 +61,10 @@ local mappings = nvchad.load_config().mappings
-- register mappings
for mode, opt in pairs(options.mode_opts) do
for key, _ in pairs(mappings) do
if mappings[key][mode] then
wk.register(mappings[key][mode], opt)
for _, value in pairs(mappings) do
if value[mode] then
local mode_opts = value["mode_opts"] and vim.tbl_deep_extend("force", opt, value["mode_opts"]) or opt
wk.register(value[mode], mode_opts)
end
end
end