Productivity

VS Code Command Palette: Run Any Command Without Touching Menus

📅 Updated: December 2025 ⏱️ 6 min read 💻 Windows, Mac, Linux

VS Code's Command Palette is the fastest way to do almost anything in the editor. Instead of hunting through menus or remembering dozens of keyboard shortcuts, press Ctrl+Shift+P (or Cmd+Shift+P on Mac) and type what you want to do.

Power users do 90% of their VS Code navigation here. Once you internalize this, you'll rarely touch the menus again.

Opening the Command Palette

Action Windows/Linux Mac
Command Palette (all commands)Ctrl+Shift+PCmd+Shift+P
Quick Open (files)Ctrl+PCmd+P
Go to SymbolCtrl+Shift+OCmd+Shift+O
Go to LineCtrl+GCmd+G

Quick Open Prefixes

From Quick Open (Ctrl+P), use these prefixes for different modes:

  • > - Commands (same as Ctrl+Shift+P)
  • @ - Symbols in current file
  • @: - Symbols grouped by category
  • # - Symbols in workspace
  • : - Go to line number
  • ? - Show all prefix options

💡 Pro Tip: Type Partial Matches

You don't need to type exact command names. "format doc" finds "Format Document," "tog term" finds "Toggle Terminal." The fuzzy matching is very forgiving.

Essential Commands to Know

Editor Commands

  • "Format Document" - Auto-format code according to your settings
  • "Transform to Uppercase/Lowercase" - Change text case
  • "Sort Lines Ascending/Descending" - Sort selected lines
  • "Toggle Word Wrap" - Wrap long lines
  • "Toggle Minimap" - Show/hide the code minimap
  • "Toggle Zen Mode" - Distraction-free editing

File/Workspace Commands

  • "File: Save All" - Save all open files
  • "File: Close All" - Close all editors
  • "Preferences: Open Settings (JSON)" - Direct settings file access
  • "Reload Window" - Restart VS Code (fixes most issues)
  • "Developer: Reload Window" - Same as above

Navigation Commands

  • "Go to Definition" - Jump to function/variable definition
  • "Go to References" - Find all usages
  • "Peek Definition" - View definition inline
  • "Go Back/Forward" - Navigate edit history

Accessing Settings

The Command Palette is the fastest way to change settings:

  1. Open Settings UI

    Type "settings" and select "Preferences: Open Settings (UI)"

  2. Open Settings JSON

    Type "settings json" for direct file editing

  3. Search Specific Settings

    Type the setting name directly: "font size," "tab size," "auto save"

Extension Commands

Every extension adds commands to the palette. Common ones:

  • "GitLens: Toggle File Blame" - Show git blame in editor
  • "Prettier: Format Document" - Format with Prettier
  • "ESLint: Fix all auto-fixable Problems" - Auto-fix lint issues
  • "Live Server: Open with Live Server" - Start local server
  • "Remote-SSH: Connect to Host" - SSH into remote machine

⚠️ Extension Overload

Too many extensions slow down VS Code and clutter the Command Palette. Periodically review installed extensions and disable/uninstall unused ones via "Extensions: Show Installed Extensions."

Customizing Keybindings

For commands you use constantly, add custom keybindings:

  1. Open Keyboard Shortcuts

    Type "keyboard shortcuts" in Command Palette

  2. Search for Command

    Find the command you want to bind

  3. Add Binding

    Click the + icon and press your desired key combination

Power User Workflows

Quick File Switching

Ctrl+P → type filename → Enter
// Even faster: Ctrl+Tab to cycle recent files

Find and Replace Across Files

Ctrl+Shift+P → "Replace in Files" → Enter

Change Language Mode

Ctrl+Shift+P → "Change Language Mode" → select language

Compare Files

Ctrl+Shift+P → "Compare Active File With..." → select file

Conclusion

The Command Palette is VS Code's superpower. Instead of memorizing 100 shortcuts, remember one: Ctrl+Shift+P. Then type what you want to do. The fuzzy search finds it, you press Enter, and it's done.

Start using it for everything—settings changes, formatting, git commands, extension features—and watch your editing speed increase dramatically.