I accidentally removed a whole keyboard shortcut instead of just removing the associated keys. I don't exactly remember which one I removed and I have no idea on how to bring it back. How can I bring it back?
4 Answers
Try putting it back to default settings, it should do the trick...
Single binding to default:
- Go to File > Preferences > Keyboard Shortcuts
- Look for three vertical dots in the upper right corner
- Select "Show User Keybindings"
- Right click on key you want to and select "Reset keybinding"
All bindings to default:
- Press Ctrl + Shift + P
- Type "Open Keyboard Shortcuts (JSON)" and open it
- Remove everything from keybindings.json and type empty [ ] into it.
- Click save and reopen VSCode
-
That did the trick. I was not expecting that because the deleted binding was not listed as deleted in this file but nevertheless - thanks! – DerThronprinz Aug 31 '22 at 07:03
You can locate keybindings.json file in %appdata%\Code\User folder and see what keybinding have been removed. If you delete this file it will reset keybindings to default

- 338
- 1
- 3
- 11
If you accidentally removed a keyboard shortcut in Visual Studio Code and want to restore it to its default value, you can follow these steps:
Open VS Code.
Go to the "File" menu (located at the top-left corner) and select "Preferences," then choose "Keyboard Shortcuts." You can also use the shortcut Ctrl + K Ctrl + S.
In the keyboard shortcuts editor, there is a search bar at the top. Type a keyword or a part of the action name that you want to restore. This will filter the list of commands.
Locate the action that you believe you accidentally removed. The default keybindings are displayed on the right side.
If the action you're looking for has a blank keybinding (indicating that you removed it), you can right-click on it and choose "Reset Keybinding" from the context menu. This will restore the default keybinding for that action.
Alternatively, you can click the pencil icon next to the action to edit the keybinding, and then press the key combination you want to assign to it.
After restoring or assigning the keybinding, the changes should be saved automatically. You can now close the keyboard shortcuts editor.

- 62
- 7
If it was "deleted" by un-registering it (starting the command property with a "-
") from somewhere else (Ex. if it was initially registered as default at the system level), then just find the JSON object in your keybindings.json file (use Preferences: Open Keyboard Shortcuts (JSON)
in the command palette) that un-registers it and delete it.
If was actually deleted instead of just "un-registered"- I.e. if there is no longer any trace of it in the keybindings.json, then you can try opening the file timeline for the keybindings.json file (Use the Explorer: Focus on Timeline View
command in the command palette) to see if any record of it is saved in the timeline. If not, and you haven't done anything else to keep backups of your config files (Ex. Git repo), then I think you're out of luck.

- 20,030
- 7
- 43
- 238