Keybindings, also known as keyboard shortcuts, are combinations of keys on your keyboard that, when pressed together, perform specific actions. For example, pressing Ctrl + Shift + F will open search, where you can search for items that are already open in VSCode.
VS Code Keyboard Shortcuts are extremely useful because they allow us to perform tasks more quickly and efficiently while writing code. You can customize your shortcut keys in Visual Studio Code to perform most tasks directly from the keyboard. It is possible that you have made unnecessary changes to the visual studio code shortcuts.
How to reset individual keybindings in Visual Studio Code?
When multiple commands exist for the same keybinding or you have made unnecessary changes to it, we like to reset keybindings to default, and here are the steps for resetting individual keybinding to default.
Open Visual Studio Code
Goto File > Preferences > Keyboard Shortcuts for Windows. ( Code > Preferences >Keyboard Shortcuts for macOS).
This will bring up the Keyboard Shortcuts editor. Using the Keyboard Shortcuts editor, Visual Studio Code provides a rich and simple keyboard shortcuts editing experience. This will give you a comprehensive list of your vscode keyboard shortcuts.
We are interested in the keybindings settings that we created and would like to reset them. So proceed to step 3.
Stay in the same Keyboard Shortcuts window and look for three vertical dots in the upper right corner, then click on them.
Then select "Show User Keybindings."
This will display a list of user-defined keybindings.
Right-click each item and select "Reset keybinding."
How to reset all keybindings in Visual Studio Code?
You can reset all keybindings by selecting each user's assigned keybinding one by one and clicking "Reset keybinding" or all at a time with the following steps.
This will be useful if you have created a large number of keyboard shortcuts and want to delete them all at once.
Press the Ctrl + Shift + P keyboard shortcut and this will open the Command Palette. There type Open Keyboard Shortcuts (JSON) and select it from the list. This will open keybindings.json.
Simply remove everything from keybindings.json and type empty [ ] into it.
Save it. Close VSCode and reopen it, and your keybindings will be restored.
We can directly navigate to the file location and delete everything from the keybindings.json and here is the location for this file.
In macOS: ~/Library/Application Support/Code/User/keybindings.json
In Windows: %UserProfile%/AppData/Roaming/Code/User/keybindings.json
In Linux: HOME/.config/Code/User/keybindings.json
If you want to learn more about VSCODE keyboard binding then visit this link:https://code.visualstudio.com/docs/getstarted/keybindings
What is keybindings.json?
Ans: It is a configuration file that contains keyboard shortcuts in Visual Studio Code. It contains a list of rules, each of which defines keyboard shortcuts and commands that it triggers.