fix: moved lsp mappings to lspconfig to only be set on lsp attach

This commit is contained in:
Leon Heidelbach 2022-05-25 01:16:08 +02:00 committed by siduck
parent c7cfacd360
commit 5ba309a0df
4 changed files with 108 additions and 29 deletions

View file

@ -63,21 +63,7 @@ local mapping_groups = { groups = vim.deepcopy(mappings.groups) }
mappings.disabled = nil
mappings.groups = nil
-- register mappings
local function register_mappings(maps, opts)
for mode, opt in pairs(opts.mode_opts) do
for key, value in pairs(maps) do
if key ~= "lspconfig" then
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
end
end
register_mappings(mappings, options)
register_mappings(mapping_groups, options)
nvchad.whichKey_map(mappings, options)
nvchad.whichKey_map(mapping_groups, options)
wk.setup(options)