Cheat Sheet Library

Visual Studio Cheat Sheet

Default "General / C#" keymap. A comma means press the combos one after another, for example Ctrl + K, Ctrl + D.

  • 69 entries
  • 10 sections
  • Updated

69 entries

On this page

Search & Navigate #

ShortcutAction
Ctrl + QFeature search (menus, settings, options)
Ctrl + T or Ctrl + ,Go To All (files, types, members)
Ctrl + Shift + TGo to file
Ctrl + GGo to line
F12Go to definition
Alt + F12Peek definition
Ctrl + F12Go to implementation
Shift + F12Find all references
Ctrl + - / Ctrl + Shift + -Navigate back / forward
Ctrl + ]Matching brace
Ctrl + TabSwitch open documents
Ctrl + F4Close document

Edit #

ShortcutAction
Ctrl + .Quick actions & refactorings (lightbulb)
Ctrl + SpaceComplete word / IntelliSense
Ctrl + Shift + SpaceParameter info
Alt + ↑/↓Move line up / down
Ctrl + DDuplicate line
Ctrl + LCut line
Ctrl + Shift + LDelete line
Ctrl + Enter / Ctrl + Shift + EnterInsert line above / below
Ctrl + K, Ctrl + /Toggle comment
Ctrl + K, Ctrl + C / Ctrl + K, Ctrl + UComment / uncomment
Ctrl + K, Ctrl + DFormat document
Ctrl + K, Ctrl + FFormat selection
Ctrl + K, Ctrl + SSurround with (if, try, region…)
Ctrl + Z / Ctrl + YUndo / redo

Multi-Caret & Selection #

ShortcutAction
Ctrl + Alt + ClickAdd 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 #

ShortcutAction
Ctrl + R, Ctrl + RRename
Ctrl + R, Ctrl + MExtract method
Ctrl + R, Ctrl + GRemove and sort usings
Ctrl + R, Ctrl + EEncapsulate field

Outlining (folding) #

ShortcutAction
Ctrl + M, Ctrl + MToggle the current block
Ctrl + M, Ctrl + OCollapse to definitions
Ctrl + M, Ctrl + LToggle all

Build & Debug #

ShortcutAction
Ctrl + Shift + BBuild solution
Ctrl + BreakCancel build
F5Start debugging / continue
Ctrl + F5Start without debugging
Shift + F5Stop debugging
Ctrl + Shift + F5Restart
F9Toggle breakpoint
Ctrl + Alt + BBreakpoints window
F10 / F11 / Shift + F11Step over / into / out
Ctrl + F10Run to cursor
Ctrl + Alt + CCall stack
Ctrl + Alt + IImmediate window
Ctrl + Alt + W, 1Watch 1

Windows #

ShortcutAction
Ctrl + Alt + LSolution Explorer
Ctrl + ;Search Solution Explorer
Ctrl + \, EError List
Ctrl + Alt + OOutput
Ctrl + `Terminal
Ctrl + 0, Ctrl + GGit Changes
F4Properties
Ctrl + Alt + XToolbox
Shift + Alt + EnterFull screen

Find #

ShortcutAction
Ctrl + F / Ctrl + HFind / replace in the file
Ctrl + Shift + F / Ctrl + Shift + HFind / replace in files
F3 / Shift + F3Next / previous result

C# Snippets (type, then Tab Tab) #

SnippetInserts
propAuto-property
ctorConstructor
cwConsole.WriteLine();
for / foreachLoops
if / tryIf block / try-catch
classClass

Tips #

  • Tools → Options → Environment → Keyboard lets you search and rebind any command.
  • Ctrl + Q → "keyboard shortcuts" shows the reference for your current keymap.