The VS Code Command Palette opens with Ctrl+Shift+P on Windows and Linux or Cmd+Shift+P on macOS. Type part of a command name, such as "format" or "settings", pick the match from the list and press Enter to run it.
Microsoft's documentation calls this the most important key combination to know in VS Code. This guide covers what the palette can do, how it differs from the neighbouring Quick Open box, and how to use it to change settings and shortcuts. Everything here comes from the official VS Code docs, and menu names may change between releases.
How to open the Command Palette
- Windows and Linux:
Ctrl+Shift+P - macOS:
Cmd+Shift+P
In the Keyboard Shortcuts editor this key is bound to a command called Show All Commands. If the shortcut does nothing on your machine, another program or an extension may have taken the key. Search for "Show All Commands" in the Keyboard Shortcuts editor to see what it is bound to, and which other bindings share the same keys.
What the Command Palette does
The docs describe it as the way to access all available commands based on your current context. In practice that means almost everything in VS Code's menus, plus many actions that have no menu item. Because the list depends on context, what you see changes with the file and view you are in. Extensions add their own commands to the same list.
Commands are named in a "Category: Action" pattern. These are examples that the official docs name directly:
| Command to type | What it does |
|---|---|
Preferences: Open Keyboard Shortcuts | Opens the Keyboard Shortcuts editor (Ctrl+K Ctrl+S) |
Preferences: Open User Settings (JSON) | Opens your user settings.json file |
Preferences: Open Settings (UI) | Opens the Settings editor |
Search: Quick Search | Starts a search across files |
Formatting commands are also run from the palette. The docs say you can invoke them from the Command Palette or the editor context menu.
Command Palette vs Quick Open
These two look alike, so people mix them up. They are separate features with separate shortcuts.
| Feature | Windows / Linux | macOS | Use it to |
|---|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P | Run a command |
| Quick Open | Ctrl+P | Cmd+P | Open a file or go to a symbol by name |
| Go to Symbol in File | Ctrl+Shift+O | Shift+Cmd+O | Jump to a symbol in the current file |
| Go to Symbol in Workspace | Ctrl+T | Cmd+T | Jump to a symbol anywhere in the project |
| Go to Line | Ctrl+G | Ctrl+G | Jump to a line number |
If you want a file, use Quick Open. If you want an action, use the Command Palette. In Go to Symbol in File, adding a colon after @ (so @:) groups the symbols by kind, according to the Tips and Tricks page.
How to see what else you can type
Type ? in the input field. The docs say this gives a list of available commands that you can run from the box, so you can see which modes the input supports without memorising them.
How to change a setting from the palette
- Press
Ctrl+Shift+P(Cmd+Shift+Pon macOS). - Type
settings. - Choose Preferences: Open User Settings (JSON) to edit the file directly, or Preferences: Open Settings (UI) for the graphical editor.
The Settings editor also has its own shortcut, Ctrl+, (Cmd+, on macOS). The docs add that if you set workbench.settings.editor to json, that shortcut opens settings.json instead of the graphical editor.
How to bind a key to a command
Run Preferences: Open Keyboard Shortcuts from the palette, search for the command, and set a key there. You can also right-click an action in the workbench and choose Configure Keybinding, which opens the same editor filtered to that command.
In keybindings.json, each rule has a key, a command and an optional when clause. This example is from the official docs:
{ "key": "ctrl+d", "command": "editor.action.deleteLines", "when": "editorTextFocus" }
The docs say the first rule that matches both the key and the when clause is accepted. Rules are evaluated from bottom to top, and your own rules are appended after the defaults, so they override them. To run several commands from one shortcut, use the runCommands command.
Move the palette
You can drag the Command Palette by its top edge to a new position. The Customize Layout control also offers preconfigured Quick Input Position choices, which apply to the other quick input boxes too.
If the palette doesn't show your command
- Wrong context. The list depends on your current context. Click into the editor you mean to act on, then open the palette again.
- Extension not active. Commands from extensions appear only when the extension is installed and enabled.
- Different name than you expect. Search for a single distinctive word, such as "format" or "keyboard", rather than the full title.
Frequently asked questions
- What is the VS Code Command Palette?
- The Command Palette is a searchable list of the commands VS Code can run, available from one keyboard shortcut. Microsoft's documentation describes it as the way to access all available commands based on your current context. You type part of a command name, pick it, and press Enter.
- What is the shortcut for the Command Palette in VS Code?
- Ctrl+Shift+P on Windows and Linux, and Cmd+Shift+P on macOS. In the Keyboard Shortcuts editor this key is bound to the command named Show All Commands.
- What is the difference between the Command Palette and Quick Open?
- The Command Palette (Ctrl+Shift+P) runs commands. Quick Open (Ctrl+P) navigates to files and symbols by name. Both are quick input boxes that appear at the top of the window, but they search different things.
- Why can't I find a command in the Command Palette?
- The palette shows commands based on your current context, so some commands only appear when the right editor or view is active. Commands added by extensions also appear only while the extension is installed and enabled. Open a file of the relevant type, click into the editor, and search again.
- How do I move the Command Palette?
- Grab its top edge with the mouse and drag it somewhere else. You can also use the Customize Layout control and choose a preconfigured Quick Input Position.