Command Palette and Quick Open

VS Code · Essentials · 6 min

Every feature is reachable from the palette, so you never need to memorise menus.

The Command Palette (Ctrl+Shift+P, or F1) lists every command VS Code and your extensions provide. Type a few letters, such as "sort lines", "toggle word wrap" or "reload window", and press Enter. The palette shows each command's keyboard shortcut, so it doubles as a way to learn shortcuts.

Quick Open (Ctrl+P) fuzzy-finds files in the workspace: usrctl finds UserController.ts. Its input supports prefixes:

  • > turns it into the Command Palette.
  • @ lists symbols (functions, classes) in the current file; @: groups them by kind.
  • # searches symbols across the workspace.
  • : goes to a line number (:120), same as Ctrl+G.
  • ? shows all available prefixes.

Press Ctrl+P repeatedly to cycle through recently opened files.

The full shortcut list is under File > Preferences > Keyboard Shortcuts (Ctrl+K Ctrl+S), where you can search by command name or by pressing the keys themselves. If you come from another editor, "keymap" extensions (Vim, Sublime, IntelliJ...) remap shortcuts to what your fingers know.

Example

# Ctrl+Shift+P  then type:
#   >Sort Lines Ascending
#   >Developer: Reload Window
#   >View: Toggle Word Wrap
# Ctrl+P  then type:
#   usrctl            fuzzy file match -> UserController.ts
#   @render           jump to symbol 'render' in this file
#   #parseConfig      symbol anywhere in the workspace
#   :120              go to line 120
# Ctrl+K Ctrl+S     open Keyboard Shortcuts editor

Remember

  • Ctrl+Shift+P runs any command; it shows their shortcuts
  • Ctrl+P opens files; @ symbols, # workspace symbols, : line
  • Ctrl+K Ctrl+S searches and edits keyboard shortcuts

Check yourself

  1. In Quick Open (Ctrl+P), what does typing `@` first do?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: code.visualstudio.com/docs/editing/getting-started/tips-and-tricks