Do you want to learn more about VSCode Command Palette and 5x your productivity in a blink of an eye? This quick guide will show you everything you need to know about leveraging the keyboard in VSCode through the use of its Command Palette.
Most code editor relies heavily on the keyboard, not just for typing, but for shortcuts and keystrokes also. In fact, the old, yet popular text editors such as
emacs don’t need a mouse to satisfy a large user base.
VSCode has won the hearts of keyboard ninjas too, thanks to the Command Palette.
Open Command Palette in VSCode
In order to bring up VSCode Command Palette, you press Ctrl + Shift + P combination.
Almost every functions of Visual Studio Code can be accessed via the Command Palette. You can start typing immediately after pressing the hotkeys, you’ll receive a list of matching commands instantly. Key combination which has been assigned to the task would be displayed, too.
Example : Access Settings from Command Palette
You can access VSCode Settings in several ways.
The first one is through the menu : Edit > Preferences > Settings.
You can also quickly jump to Settings in UI mode by pressing the Ctrl + , keyboard shortcut.
But using Command Palette allows you to access VSCode Settings in both UI mode and JSON mode. There are advanced settings which can only be configured using JSON mode.
Plus, using Command Palette opens access to all sorts of scope-based settings such as Folder Settings, Workspace Settings, User Settings, Default Settings.
- Open up VSCode and press Ctrl + Shift + P to open Command Palette
- Type “settings” (without the double quote) to search. Once you see the ones you’re looking for, use arrow keys to move to it and press Enter or use your mouse to select it.
Clear Command Palette History
You can use the Command Palette itself to clear the Command Palette history following step by step instructions below.
- Open up VSCode and press Ctrl + Shift + P to open Command Palette.
- Type in “clear” and select Clear Command History. Voilà, your command history is now empty.
Change Command Palette History Settings
VSCode allows you to limit how many recent command to be saved or disable it completely.
Open up VSCode and press Ctrl + Shift + P to open Command Palette.
Type in “settings” and select Preferences: Open Settings (UI).
Search for “palette”. Once you see Workbench › Command Palette: History, you can set it to another number of command history you want VSCode to keep. Alternatively, you can set the value to 0 to disable Command Palette History altogether.
You can also tick the checkbox in front of Workbench › Command Palette: Preserve Input in the settings to pre-fill the Command Palette with the most recently used command. This feature saves time, especially when you need to use one command over and over again.
How to open VSCode Command Palette?
Open VSCode and press Ctrl + Shift + P
What's the advantages of using VSCode Command Palette?
It's faster, similar to how you would use keyboard shortcuts in programs. Once you're familiar with Command Palette, you won't have to remember the position of each setting in the menu.
Can VSCode Command Palette access all of VSCode functionality?
Yes, using Command Palette allows you to reach every part of the program. Plus, it does offer a few additional features.
Command Palette does not show results as I type or showing only files instead of commands, what's wrong?
Make sure that in front of your text is a “greater than” character as it's helps VSCode detects that you're searching for commands. If you accidentally deleted it, press Esc and Ctrl + Shift + P to reopen Command Palette again.