Blog · · 4 min read

VS Code shortcuts cheat sheet for Windows

The Visual Studio Code keyboard shortcuts on Windows that pay off every day, from the Command Palette and multi-cursor editing to navigation and the terminal, with tips to make them stick.

VS Code has a shortcut for almost everything, and one shortcut that finds all the others. Learn that one first, then the dozen editing and navigation keys you will use every hour.

The list is for VS Code on Windows with the default keymap, from the official Windows keyboard shortcut reference and the VS Code documentation. Extensions and keymap packs can change keys; File > Preferences > Keyboard Shortcuts (Ctrl+K Ctrl+S) shows what is active and lets you search by key. To change one, find the command there, double-click it and press the new keys.

The one to learn first

  • Ctrl+Shift+P or F1 opens the Command Palette. Every command in VS Code is there, and the list shows each command's shortcut next to its name.
  • Ctrl+P opens Quick Open: type part of a file name and press Enter.

Quick Open does more than files. Type > to switch to commands, @ for symbols in the current file, : followed by a number for a line.

Editing lines

  • Alt+Up and Alt+Down move the current line up or down.
  • Shift+Alt+Up and Shift+Alt+Down copy the line up or down.
  • Ctrl+Shift+K deletes the line.
  • Ctrl+Enter inserts a line below, Ctrl+Shift+Enter above, wherever the cursor is in the line.
  • Ctrl+L selects the current line.
  • Ctrl+/ comments or uncomments the line.
  • Shift+Alt+A toggles a block comment.
  • Alt+Z turns word wrap on or off.

Indent and fold

  • Ctrl+] indents the line.
  • Ctrl+[ outdents it.
  • Ctrl+Shift+[ folds the current region.
  • Ctrl+Shift+] unfolds it.
  • Ctrl+K Ctrl+0 folds everything, Ctrl+K Ctrl+J unfolds everything.

Multiple cursors

  • Ctrl+D selects the next occurrence of the current word. Press it again for the one after.
  • Ctrl+Shift+L selects every occurrence at once.
  • Alt+Click adds a cursor where you click.
  • Ctrl+Alt+Up and Ctrl+Alt+Down add a cursor on the line above or below.

Start with Ctrl+D. Put the cursor on a variable name, press Ctrl+D a few times, type the new name, and every selected occurrence changes together.

Finding

  • Ctrl+F finds in the file, Ctrl+H replaces.
  • F3 and Shift+F3 go to the next and previous match.
  • Ctrl+Shift+F searches in all files.
  • Ctrl+Shift+H replaces in all files.
  • Ctrl+G goes to a line number.
  • Ctrl+Shift+O goes to a symbol in the current file.
  • Ctrl+T goes to a symbol anywhere in the workspace.
  • F12 goes to the definition, Alt+F12 peeks at it in place.
  • Shift+F12 shows the references.
  • F2 renames the symbol everywhere it is used.
  • Ctrl+. shows quick fixes and refactorings.
  • Ctrl+Shift+M opens the Problems panel, F8 jumps to the next problem.

Formatting

  • Shift+Alt+F formats the whole document.
  • Ctrl+K Ctrl+F formats only the selection.

Editors and layout

  • Ctrl+\ splits the editor.
  • Ctrl+1, Ctrl+2, Ctrl+3 move the focus to the first, second or third editor group.
  • Ctrl+W closes the editor, Ctrl+Shift+T reopens the last one you closed.
  • Ctrl+B shows or hides the side bar.
  • Ctrl+Shift+E Explorer, Ctrl+Shift+G Source Control, Ctrl+Shift+D Run and Debug, Ctrl+Shift+X Extensions.
  • Ctrl+K Z enters Zen Mode; Esc twice leaves it.
  • Ctrl+= and Ctrl+- zoom the whole window, F11 switches to full screen.
  • Ctrl+, opens Settings.
  • Ctrl+Shift+U shows the Output panel, Ctrl+Shift+V opens a Markdown preview.
  • Ctrl+K R reveals the active file in File Explorer.
  • Ctrl+K P copies the path of the active file.

Terminal and debugging

  • Ctrl+` shows or hides the integrated terminal.
  • Ctrl+Shift+` opens a new terminal.
  • F5 starts or continues debugging, Shift+F5 stops.
  • F9 toggles a breakpoint.
  • F10 steps over, F11 steps into.

How to remember them

  1. Let the Command Palette teach you. Every time you run a command from Ctrl+Shift+P, read the shortcut printed next to it. Use the key the next time.
  2. Alt moves, Shift+Alt copies. Alt+Up moves a line, Shift+Alt+Up copies it.
  3. Ctrl+Shift plus a letter opens a view: Explorer, Find in files, Git, Debug, eXtensions.
  4. Ctrl+K is a prefix. Press Ctrl+K, let go, then press the second key. Z for Zen, P for path, R for reveal, S for shortcuts.
  5. Two a week. Ctrl+D and Alt+Up first, because they replace the most mouse work in plain editing.

A VS Code ring

RadialDeck is the radial menu for Windows that we make. When VS Code is in front, the hotkey or a side mouse button opens a VS Code ring. Hold, flick toward a slice, let go.

The gallery has 11 ready-made VS Code slices: Command palette, Format document, Zen mode, Quick open, Debug, Sidebar, Find in files, Source control, Settings, Terminal and Comment. The VS Code page lists what each one does.

It earns its place when you are reading code with one hand on the mouse, and for the two-step chords like Ctrl+K Z that are easy to forget. The gallery's File Explorer slices include VS Code in this folder and Terminal in this folder, which open the folder you are looking at.

Quick reference

  • Find anything: Ctrl+Shift+P, Ctrl+P, Ctrl+Shift+F
  • Edit lines: Alt+Up, Shift+Alt+Down, Ctrl+Shift+K, Ctrl+/
  • Multi-cursor: Ctrl+D, Ctrl+Shift+L, Alt+Click
  • Navigate: F12, Shift+F12, F2, Ctrl+G
  • Layout: Ctrl+B, Ctrl+\, Ctrl+K Z

RadialDeck is free for two rings and has a 14-day trial of Pro, which adds a ring per program such as VS Code. It is in the Microsoft Store.

Try it in RadialDeck

Free for two rings, with a 14-day trial of everything in Pro. Windows 10 and 11, from the Microsoft Store.

Get it from Microsoft or download the installer (.exe)