VS Code Shortcuts Cheat Sheet
1. Quick Reference
TechSilo
AI-assisted and human-curated
1. **Quick Reference**
The following table lists the most common VS Code shortcuts:
| Shortcut | Action |
| --- | --- |
| Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac) | Open Command Palette |
| Ctrl + Shift + E (Windows/Linux) or Cmd + Shift + E (Mac) | Open Explorer |
| Ctrl + Shift + F (Windows/Linux) or Cmd + Shift + F (Mac) | Format Code |
| F5 | Run Code |
| Ctrl + / (Windows/Linux) or Cmd + / (Mac) | Toggle Comment |
2. **Syntax**
The syntax for customizing VS Code shortcuts is as follows:
{
"key": "shortcut",
"command": "command.name",
"args": {
"arg1": "value1",
"arg2": "value2"
}
}Replace shortcut with the desired shortcut, command.name with the command name, and arg1 and arg2 with the required arguments.
3. **Common Patterns**
Here are some common shortcut patterns:
* Toggle Terminal: Ctrl + (Windows/Linux) or Cmd + (Mac)
* Open Settings: Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac), then type "Open Settings"
* Format Code: Ctrl + Shift + F (Windows/Linux) or Cmd + Shift + F (Mac)
* Debug Code: F5
4. **Gotchas**
Some common issues with VS Code shortcuts include:
* Conflicting Shortcuts: If two extensions use the same shortcut, it may not work as expected. To resolve this, open the Command Palette and type "Preferences: Open Keyboard Shortcuts" to customize the shortcuts.
* Shortcut Not Working: If a shortcut is not working, try restarting VS Code or checking for conflicts with other extensions.
* Custom Shortcut Not Saving: If a custom shortcut is not saving, check that the keybindings.json file is in the correct location and that the syntax is correct.
5. **Related Commands**
Some related commands to use with VS Code shortcuts include:
* Customizing the Status Bar: Use the statusBar command to customize the status bar.
* Customizing the Menu Bar: Use the menuBar command to customize the menu bar.
* Customizing the Keyboard: Use the keyboard command to customize the keyboard shortcuts.
Example use case:
{
"key": "Ctrl + Shift + R",
"command": "workbench.action.reloadWindow"
}This custom shortcut reloads the VS Code window when Ctrl + Shift + R is pressed.
Want to put this into practice?
Explore TechSilo's free developer tools for practical utilities you can use directly in your browser.