Visual Studio

Visual Studio keyboard shortcuts.

Build, debug, navigate and refactor in Microsoft's Windows IDE. Several commands use two-key chords.

Build & debug
Build solutionCtrl+Shift+B
Start debuggingF5
Start without debuggingCtrl+F5
Stop debuggingShift+F5
Toggle breakpointF9
Step overF10
Step intoF11
Step outShift+F11
Run to cursorCtrl+F10
Navigate
Go to All (search)Ctrl+T
Go to definitionF12
Peek definitionAlt+F12
Go to implementationCtrl+F12
Find all referencesShift+F12
Go to lineCtrl+G
Navigate backwardCtrl+-
Navigate forwardCtrl+Shift+-
Edit
IntelliSense suggestionsCtrl+Space
Format documentCtrl+K+Ctrl+D
Comment selectionCtrl+K+Ctrl+C
Uncomment selectionCtrl+K+Ctrl+U
Duplicate lineCtrl+D
Move line up / downAlt+↑/↓
FindCtrl+F
ReplaceCtrl+H
Find in filesCtrl+Shift+F
Refactor & tools
Quick actions / refactorCtrl+.
RenameCtrl+R+Ctrl+R
Extract methodCtrl+R+Ctrl+M
Toggle bookmarkCtrl+K+Ctrl+K
Solution ExplorerCtrl+Alt+L
Command windowCtrl+Alt+A
These are for Visual Studio, Microsoft's full Windows IDE — not the lighter, cross-platform VS Code, which has its own page. Many commands are two-key chords such as Ctrl + K, Ctrl + D (press Ctrl + K, then Ctrl + D). Visual Studio for Mac was retired in 2024.

Build, run, step

The debugging keys are the ones you'll wear out. F5 starts debugging and Ctrl + F5 runs without the debugger attached; once you hit a breakpoint (set with F9), F10 steps over a line, F11 steps into a call and Shift + F11 steps back out. Knowing those four movements cold is the difference between flowing through a debugging session and constantly reaching for the toolbar.

Chords and refactoring

Visual Studio leans on two-key chords, which look intimidating but are fast once they're in your fingers: Ctrl + K, Ctrl + C comments a selection and Ctrl + K, Ctrl + D reformats the file. The single most useful non-chord is Ctrl + . (Quick Actions), which surfaces refactors, missing imports and fixes right where the cursor sits. Combine it with Ctrl + T to jump to any file, type or member, and you can navigate a large solution without the mouse. For the lighter editor, see the VS Code shortcuts.

FAQ

What's the difference between Visual Studio and VS Code shortcuts?
They're different apps. Visual Studio is the full Windows IDE and uses chords like Ctrl + K, Ctrl + D; VS Code is the lighter cross-platform editor with its own (often simpler) bindings. This page covers Visual Studio.
How do I format code in Visual Studio?
Press Ctrl + K, then Ctrl + D to format the whole document, or Ctrl + K, Ctrl + F to format just the selection.

More cheatsheets