diff --git a/lua/lazy/core/handler/keys.lua b/lua/lazy/core/handler/keys.lua index 6ca2c50..815fcbb 100644 --- a/lua/lazy/core/handler/keys.lua +++ b/lua/lazy/core/handler/keys.lua @@ -163,7 +163,11 @@ end -- mapping when needed ---@param keys LazyKeys function M:_del(keys) - pcall(vim.keymap.del, keys.mode, keys.lhs) + pcall(vim.keymap.del, keys.mode, keys.lhs, { + -- NOTE: for buffer-local mappings, we only delete the mapping for the current buffer + -- So the mapping could still exist in other buffers + buffer = keys.ft and true or nil, + }) -- make sure to create global mappings when needed -- buffer-local mappings are managed by lazy if not keys.ft then