Visual Studio Cheat Sheet
Default "General / C#" keymap. A comma means press the combos one after another, for example Ctrl + K, Ctrl + D.
On this page
Search & Navigate #
| Shortcut | Action |
|---|---|
Ctrl + Q | Feature search (menus, settings, options) |
Ctrl + T or Ctrl + , | Go To All (files, types, members) |
Ctrl + Shift + T | Go to file |
Ctrl + G | Go to line |
F12 | Go to definition |
Alt + F12 | Peek definition |
Ctrl + F12 | Go to implementation |
Shift + F12 | Find all references |
Ctrl + - / Ctrl + Shift + - | Navigate back / forward |
Ctrl + ] | Matching brace |
Ctrl + Tab | Switch open documents |
Ctrl + F4 | Close document |
Edit #
| Shortcut | Action |
|---|---|
Ctrl + . | Quick actions & refactorings (lightbulb) |
Ctrl + Space | Complete word / IntelliSense |
Ctrl + Shift + Space | Parameter info |
Alt + ↑/↓ | Move line up / down |
Ctrl + D | Duplicate line |
Ctrl + L | Cut line |
Ctrl + Shift + L | Delete line |
Ctrl + Enter / Ctrl + Shift + Enter | Insert line above / below |
Ctrl + K, Ctrl + / | Toggle comment |
Ctrl + K, Ctrl + C / Ctrl + K, Ctrl + U | Comment / uncomment |
Ctrl + K, Ctrl + D | Format document |
Ctrl + K, Ctrl + F | Format selection |
Ctrl + K, Ctrl + S | Surround with (if, try, region…) |
Ctrl + Z / Ctrl + Y | Undo / redo |
Multi-Caret & Selection #
| Shortcut | Action |
|---|---|
Ctrl + Alt + Click | Add a caret |
Shift + Alt + . | Add the next matching occurrence |
Shift + Alt + ; | Select all matching occurrences |
Shift + Alt + ←/→/↑/↓ | Box (column) selection |
Shift + Alt + = / Shift + Alt + - | Expand / contract selection |
Refactor #
| Shortcut | Action |
|---|---|
Ctrl + R, Ctrl + R | Rename |
Ctrl + R, Ctrl + M | Extract method |
Ctrl + R, Ctrl + G | Remove and sort usings |
Ctrl + R, Ctrl + E | Encapsulate field |
Outlining (folding) #
| Shortcut | Action |
|---|---|
Ctrl + M, Ctrl + M | Toggle the current block |
Ctrl + M, Ctrl + O | Collapse to definitions |
Ctrl + M, Ctrl + L | Toggle all |
Build & Debug #
| Shortcut | Action |
|---|---|
Ctrl + Shift + B | Build solution |
Ctrl + Break | Cancel build |
F5 | Start debugging / continue |
Ctrl + F5 | Start without debugging |
Shift + F5 | Stop debugging |
Ctrl + Shift + F5 | Restart |
F9 | Toggle breakpoint |
Ctrl + Alt + B | Breakpoints window |
F10 / F11 / Shift + F11 | Step over / into / out |
Ctrl + F10 | Run to cursor |
Ctrl + Alt + C | Call stack |
Ctrl + Alt + I | Immediate window |
Ctrl + Alt + W, 1 | Watch 1 |
Windows #
| Shortcut | Action |
|---|---|
Ctrl + Alt + L | Solution Explorer |
Ctrl + ; | Search Solution Explorer |
Ctrl + \, E | Error List |
Ctrl + Alt + O | Output |
Ctrl + ` | Terminal |
Ctrl + 0, Ctrl + G | Git Changes |
F4 | Properties |
Ctrl + Alt + X | Toolbox |
Shift + Alt + Enter | Full screen |
Find #
| Shortcut | Action |
|---|---|
Ctrl + F / Ctrl + H | Find / replace in the file |
Ctrl + Shift + F / Ctrl + Shift + H | Find / replace in files |
F3 / Shift + F3 | Next / previous result |
C# Snippets (type, then Tab Tab) #
| Snippet | Inserts |
|---|---|
prop | Auto-property |
ctor | Constructor |
cw | Console.WriteLine(); |
for / foreach | Loops |
if / try | If block / try-catch |
class | Class |
Tips #
- Tools → Options → Environment → Keyboard lets you search and rebind any command.
Ctrl + Q→ "keyboard shortcuts" shows the reference for your current keymap.
Nothing on this sheet matches “”.