VS Code Shortcuts Cheat Sheet
To customize your VS Code shortcuts, you can use the following syntax in your keybindings.json file:
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 + N (Windows/Linux) or Cmd + Shift + N (Mac) | New Window |
| Ctrl + Shift + W (Windows/Linux) or Cmd + Shift + W (Mac) | Close Window |
| Ctrl + Tab (Windows/Linux) or Cmd + Tab (Mac) | Switch between open files |
| F5 | Run/Debug |
2. **Syntax**
To customize your VS Code shortcuts, you can use the following syntax in your keybindings.json file:
{
"key": "ctrl+shift+p",
"command": "workbench.action.showCommands",
"when": "editorLangId == 'javascript'"
}In this syntax:
* key is the shortcut key combination
* command is the command to execute
* when is the condition under which the shortcut is active
3. **Common Patterns**
Here are some common shortcut patterns you can copy-paste into your keybindings.json file:
* Toggle Terminal:
{
"key": "ctrl+`",
"command": "workbench.action.toggleTerminal"
}* Format Document:
{
"key": "ctrl+k ctrl+d",
"command": "editor.action.formatDocument"
}* Go to Line:
{
"key": "ctrl+g",
"command": "workbench.action.gotoLine"
}* Quick Open:
{
"key": "ctrl+p",
"command": "workbench.action.quickOpen"
}4. **Gotchas**
Some common issues with VS Code shortcuts include:
* Conflicting shortcuts: If you have multiple extensions installed, they may conflict with each other's shortcuts. To resolve this, check the keybindings.json file and remove or modify the conflicting shortcuts.
* Shortcut not working: If a shortcut is not working, check that you have the correct when condition in your keybindings.json file.
5. **Related Commands**
Some related commands to use with VS Code shortcuts include:
* workbench.action.showCommands to open the Command Palette
* editor.action.formatDocument to format the current document
* workbench.action.toggleTerminal to toggle the terminal
* workbench.action.quickOpen to quickly open a file or folder
You can use these commands in your keybindings.json file to create custom shortcuts.
Want to put this into practice?
Explore TechSilo's free developer tools for practical utilities you can use directly in your browser.
Related blog posts
CSS Flexbox Cheat Sheet: Alignment, Wrapping, and Responsive Rows
A practical CSS Flexbox reference covering display:flex, flex-direction, gap, justify-content, align-items, flex-wrap, and flex shorthand.
Read postCSS Grid Cheat Sheet: Columns, Rows, Areas, and Responsive Layouts
A practical CSS Grid reference with repeat(), minmax(), auto-fit, alignment, named areas, and responsive layout examples.
Read postnpm Scripts Cheat Sheet: Commands, Arguments, and Automation
A developer reference for package.json scripts, npm run, pre/post hooks, environment variables, and safe task automation.
Read postTypeScript Utility Types Cheat Sheet: Pick, Omit, Partial and More
Practical examples of TypeScript Partial, Required, Pick, Omit, Record, ReturnType, Awaited, Extract, and Exclude.
Read postGit Commands Cheat Sheet
1. Quick Reference | Command | Description | | --- | --- | | git init | Initialize a new Git repository | | git clone [url] | Clone a Git repository from a URL | | git add [file] | Stage a file ...
Read post