diff --git a/lua/oil/config.lua b/lua/oil/config.lua index cafa783..c59e1bb 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -409,6 +409,12 @@ M.setup = function(opts) -- We don't want to deep merge the keymaps, we want any keymap defined by the user to override -- everything about the default. for k, v in pairs(opts.keymaps) do + local normalized = vim.api.nvim_replace_termcodes(k, true, true, true) + for existing_k, _ in pairs(new_conf.keymaps) do + if existing_k ~= k and vim.api.nvim_replace_termcodes(existing_k, true, true, true) == normalized then + new_conf.keymaps[existing_k] = nil + end + end new_conf.keymaps[k] = v end end