void (@NotNull Keymap currentKeymap) { KeymapManager keymapManager = KeymapManager.getInstance(); assert keymapManager instanceof KeymapManagerEx; Keymap[] allKeymaps = ((KeymapManagerEx)keymapManager).getAllKeymaps(); String name = SchemeNameGenerator.getUniqueName(KeyMapBundle.message("keymap.with.patched.redo.name", currentKeymap.getPresentableName()), n -> ContainerUtil.exists(allKeymaps, t -> n.equals(t.getName()) || n.equals(t.getPresentableName()))); Keymap newKeymap = currentKeymap.deriveKeymap(name); KeyboardShortcut shortcut = KeyboardShortcut.fromString("control Y"); newKeymap.removeShortcut(IdeActions.ACTION_EDITOR_DELETE_LINE, shortcut); newKeymap.addShortcut(IdeActions.ACTION_REDO, shortcut); ((KeymapManagerEx)keymapManager).getSchemeManager().addScheme(newKeymap); ((KeymapManagerEx)keymapManager).setActiveKeymap(newKeymap); }