Visual Studio Keyboard Shortcuts: Complete Cheat Sheet (Windows & Mac)

Every time you reach for the mouse in Visual Studio, you lose 2–3 seconds. That sounds trivial until you multiply it by the hundreds of times it happens every coding session. Developers who rely on keyboard shortcuts consistently report finishing tasks faster, staying in flow longer, and making fewer context-switching errors.

Microsoft Visual Studio ships with over 500 built-in keyboard shortcuts across all contexts. This guide covers the ones that matter most for everyday development navigation, code editing, IntelliSense, refactoring, debugging, and build management organized by task so you can learn them in the order that helps your workflow most.

Shortcuts are listed for Windows (VS 2022 and VS 2019) and Visual Studio for Mac, using the General keyboard profile unless noted. A free printable PDF cheat sheet is available at the bottom of this page.

Did you know? According to the Stack Overflow Developer Survey, Visual Studio is consistently one of the top 3 most-used IDEs worldwide. Mastering its keyboard shortcuts is one of the highest-ROI productivity investments any .NET or C# developer can make.

Most-used Visual Studio shortcuts

These are the shortcuts every Visual Studio developer uses daily, regardless of language or project type.

ActionWindows ShortcutNotes
Create new projectCtrl + Shift + NOpens New Project dialog
Open fileCtrl + O
Open project / solutionCtrl + Shift + O
Save current fileCtrl + S
Save all filesCtrl + Shift + SRecommended habit before builds
UndoCtrl + Z
RedoCtrl + Shift + Z
CutCtrl + XCuts entire line if nothing selected
CopyCtrl + C
PasteCtrl + V
Paste from clipboard ringCtrl + Shift + VCycles through clipboard history
Select allCtrl + A
PrintCtrl + P
Full-screen modeShift + Alt + EnterToggle IDE full screen
Close current tabCtrl + F4
Go to next documentCtrl + F6
Go to previous documentCtrl + Shift + F6
RenameF2In Solution Explorer context
Add new item to projectCtrl + Shift + A
Close dialog / menuEsc

Navigation shortcuts

Navigation shortcuts let you move through large codebases without touching the Solution Explorer or reaching for the mouse. These are among the highest-ROI shortcuts to learn.

Code navigation

ActionWindows ShortcutNotes
Go to DefinitionF12Jumps to where a symbol is defined the single most-used navigation shortcut in VS
Go to Declaration / ImplementationCtrl + F12Navigates to the implementation, not just the interface
Peek Definition (inline preview)Alt + F12Opens definition in an inline window stay in your current file
Find All ReferencesShift + F12Shows every location in the solution where a symbol is used
Go to All (files, types, members, symbols)Ctrl + ,The fastest way to jump anywhere in a large solution
Navigate backwardCtrl + –Jump back to previous cursor location
Navigate forwardCtrl + Shift + –
Cycle through open filesCtrl + TabShows all open documents in a switcher
Go to line numberCtrl + GOpens Go To Line dialog
Go to matching braceCtrl + ]Jumps between opening and closing braces
Find SymbolAlt + F12
Display Navigate ToCtrl + ,

Cursor and selection movement

ActionWindows Shortcut
Move one word rightCtrl + →
Move one word leftCtrl + ←
Jump to next occurrence of highlighted symbolCtrl + Shift + ↓
Jump to previous occurrence of highlighted symbolCtrl + Shift + ↑
Extend selection to end of lineShift + End
Extend selection to start of lineShift + Home
Extend selection to end of documentCtrl + Shift + End
Extend selection to start of documentCtrl + Shift + Home
Extend selection one word rightCtrl + Shift + →
Extend selection one word leftCtrl + Shift + ←
Select current wordCtrl + W
Extend selection down one pageShift + Page Down
Extend selection up one pageShift + Page Up
Extend selection to matching braceCtrl + Shift + ]

Code editing shortcuts

These shortcuts handle the tasks you perform hundreds of times per session formatting, commenting, deleting, and rearranging lines.

ActionWindows ShortcutNotes
Comment selected codeCtrl + K, CAdds // to each selected line
Uncomment selected codeCtrl + K, URemoves // from each selected line
Format documentCtrl + K, DApplies your code formatting settings to entire file
Format selectionCtrl + K, FFormats only the selected code
Delete current lineCtrl + LDeletes the entire line and moves cursor up
Duplicate lineCtrl + E, VCopies current line below without clipboard
Delete word to the right of cursorCtrl + Delete
Delete word to the left of cursorCtrl + Backspace
Insert blank line above cursorCtrl + Enter
Insert blank line below cursorCtrl + Shift + Enter
Make selection uppercaseCtrl + Shift + U
Make selection lowercaseCtrl + U
Collapse / expand current regionCtrl + M, MToggle outlining on current block
Collapse all regionsCtrl + M, A
Expand all regionsCtrl + M, X
Hide current selectionCtrl + M, HCollapses custom-selected code
Collapse declaration bodiesCtrl + M, O
Visualise whitespaceCtrl + Shift + 8Toggle whitespace visibility
Remove whitespace and tabs in selectionCtrl + K, \
Incremental searchCtrl + ISearch as you type, forward
Reverse incremental searchCtrl + Shift + ISearch as you type, backward
Display parameter info for methodCtrl + Shift + SpaceShows required parameters for the current method call
Display symbol declarationCtrl + F12
Display symbol definitionF12

Refactoring shortcuts

Refactoring shortcuts are among the most searched-for Visual Studio shortcuts and the ones most often missing from basic cheat sheets. These let you restructure code safely without manual find-and-replace.

ActionWindows ShortcutNotes
Quick Actions & refactoringsCtrl + .The most powerful shortcut in VS shows all available code actions, fixes, and refactoring suggestions at cursor
Rename symbolCtrl + R, RRenames a variable, method, or class and updates all references across the entire solution
Extract methodCtrl + R, MExtracts selected code into a new method
Encapsulate fieldCtrl + R, EWraps a field in a property with getter/setter
Remove and sort usingsCtrl + R, GCleans up unnecessary using statements
Generate method stubCtrl + K, M
Surround with snippetCtrl + K, SWraps selected code in a try/catch, if, foreach, etc.
Insert snippetCtrl + K, XOpens snippet picker at cursor

Pro tip: Ctrl+. is everything
Ctrl + . (Quick Actions) is the closest thing VS has to an AI assistant shortcut. It surfaces: fix suggestions for compiler errors, import namespace options, generate constructor/property shortcuts, implement interface stubs, convert expression bodies, and dozens of other code transformations all contextually. Learn this one first.

IntelliSense shortcuts

IntelliSense is Visual Studio’s code completion system. These shortcuts let you control it without breaking your typing flow.

ActionWindows ShortcutNotes
Trigger IntelliSense completion listCtrl + SpaceBrings back the completion list if it was dismissed
Open completion list (alternate)Ctrl + J
Show parameter infoCtrl + Shift + SpaceDisplays the signature and parameter types for the current method
Toggle completion / suggestion modeCtrl + Alt + SpaceSwitches between full completion and suggestion-only mode
Quick info tooltipHover or Ctrl + K, IShows full type info for symbol under cursor
Complete word from listCtrl + SpaceAuto-completes the current word
Expand code snippetType prefix then Tab + TabE.g. type prop then Tab twice for auto property

Debugging shortcuts

Debugging shortcuts are the second most-searched shortcut category after general editing. Master these and you’ll spend far less time hunting bugs.

Starting and stopping the debugger

ActionWindows ShortcutNotes
Start debuggingF5Builds and runs with debugger attached
Start without debuggingCtrl + F5Runs the app without attaching the debugger faster startup
Stop debuggingShift + F5Terminates the debugging session
Restart debuggingCtrl + Shift + F5Stops and immediately restarts the debugger
Attach to processCtrl + Alt + POpens Attach to Process dialog

Breakpoints

ActionWindows ShortcutNotes
Toggle breakpointF9Sets or removes a breakpoint on the current line
Insert new function breakpointCtrl + BBreak on entry to a named function
Enable / disable breakpointCtrl + F9Toggles breakpoint without removing it
Delete all breakpointsCtrl + Shift + F9Use with caution
Run to cursorCtrl + F10Runs to the line where cursor sits temporary breakpoint

Stepping through code

ActionWindows ShortcutNotes
Step overF10Executes current line; if it’s a function call, runs the whole function
Step intoF11Executes current line; if it’s a function call, steps inside it
Step outShift + F11Runs the rest of the current function and returns to the caller
Set next statementCtrl + Shift + F10Changes which line will execute next powerful for re-running logic
Show next statementAlt + *Highlights the next line to be executed
Toggle disassembly / user code viewCtrl + F11

Watch windows and inspection

ActionWindows ShortcutNotes
Show QuickWatch windowCtrl + Alt + QEvaluate an expression or inspect a variable value
Show Exceptions dialogCtrl + Alt + EConfigure which exceptions break the debugger
Show Output windowCtrl + Shift + O
Show Error ListCtrl + \, E
Show Call Stack windowCtrl + Alt + C
Show Locals windowCtrl + Alt + V, L

Pro tip – Run to cursor vs breakpoint
Use Ctrl + F10 (Run to Cursor) instead of setting a breakpoint when you only need to pause execution once. It’s faster and keeps your breakpoint list clean.

Build shortcuts

ActionWindows ShortcutNotes
Build solutionCtrl + Shift + BCompiles only files that have changed since last build
Build solution (alternate)F6
Rebuild solutionCtrl + Alt + F7Clean + full build use when build cache is stale
Cancel buildCtrl + BreakStops a running build immediately
Show Error ListCtrl + \, EOpens error list after build

Search & replace shortcuts

ActionWindows ShortcutNotes
Find (in current file)Ctrl + F
Find nextF3
Find previousShift + F3
Find next in selected textCtrl + F3
Find previous in selected textCtrl + Shift + F3
Find in files (solution-wide)Ctrl + Shift + FSearches across all files in solution
Replace (in current file)Ctrl + H
Replace in files (solution-wide)Ctrl + Shift + H
Find All References for symbolShift + F12
Find symbolAlt + F12
Put cursor in Find / Command boxCtrl + D
Quick find symbolShift + Alt + F12

Bookmark shortcuts

Bookmarks let you mark lines you want to return to quickly useful when working across multiple files in a complex feature.

ActionWindows Shortcut
Toggle bookmark on current lineCtrl + K, K
Go to next bookmarkCtrl + K, N
Go to previous bookmarkCtrl + K, P
Go to next bookmark in folderCtrl + Shift + K, N
Go to previous bookmark in folderCtrl + Shift + K, P
Focus on Bookmark windowCtrl + K, W
Toggle code shortcut on current lineCtrl + K, H
Clear all bookmarksCtrl + K, L

Code snippet shortcuts

Code snippets are pre-built templates that expand into common code patterns. Type the trigger prefix and press Tab + Tab to expand.

Snippet triggerExpands toLanguage
prop + Tab TabAuto-implemented propertyC#
propfull + Tab TabFull property with backing fieldC#
ctor + Tab TabConstructorC#
for + Tab Tabfor loopC#, VB
foreach + Tab Tabforeach loopC#
while + Tab Tabwhile loopC#, VB
do + Tab Tabdo…while loopC#
if + Tab Tabif blockC#, VB
else + Tab Tabelse blockC#
switch + Tab Tabswitch statementC#
try + Tab Tabtry/catch blockC#
tryf + Tab Tabtry/finally blockC#
class + Tab TabClass declarationC#
interface + Tab TabInterface declarationC#
enum + Tab TabEnum declarationC#
svm + Tab Tabstatic void Main blockC#
cw + Tab TabConsole.WriteLine()C#
lock + Tab Tablock blockC#
using + Tab Tabusing statement (IDisposable)C#
ActionWindows ShortcutNotes
Insert snippet at cursorCtrl + K, XOpens snippet picker
Surround selected code with snippetCtrl + K, SWraps selection in try/catch, if, foreach, etc.
Open Code Snippet ManagerCtrl + K, BBrowse and manage all available snippets

Window & tool management shortcuts

ActionWindows ShortcutNotes
Open Solution ExplorerCtrl + Shift + L
Open Class ViewCtrl + Shift + C
Open Command windowCtrl + Alt + ARun VS commands directly
Open Output windowCtrl + Shift + O
Open Server ExplorerCtrl + Alt + S
Open Resource ViewCtrl + Shift + E
Open Call Hierarchy windowCtrl + Alt + KSee all callers and callees of a method
Open Bookmark windowCtrl + K, W
Open Macro IDEAlt + F11
Close Find & Replace windowShift + Esc
Open Code Snippet ManagerCtrl + K, B
Go to next windowCtrl + F6
Go to previous windowCtrl + Shift + F6

Visual Studio for Mac shortcuts

Visual Studio for Mac uses a different key binding scheme based on macOS conventions. The most common modifier key mappings: Windows Ctrl ≈ Mac ⌘, and Windows Alt ≈ Mac Option.

General & file management (Mac)

ActionMac Shortcut
New project⌘ + Shift + N
Open file⌘ + O
Save⌘ + S
Save all⌘ + Shift + S
Close document⌘ + W
Undo⌘ + Z
Redo⌘ + Shift + Z
Select all⌘ + A
Find⌘ + F
Find in files⌘ + Shift + F
Replace⌘ + H
Preferences⌘ + ,

Navigation (Mac)

ActionMac Shortcut
Go to Definition⌘ + D
Find References⌘ + Shift + R
Go to line⌘ + L
Go to file⌘ + Shift + D
Navigate back⌘ + [
Navigate forward⌘ + ]
Go to matching brace⌘ + Shift + \
Go to beginning of file⌘ + ↑
Go to end of file⌘ + ↓

Code editing (Mac)

ActionMac Shortcut
Comment / uncomment line or selection⌘ + /
Format document⌘ + Option + F
Delete line⌘ + Shift + K
Duplicate line⌘ + D
Move line upOption + ↑
Move line downOption + ↓
Insert line below⌘ + Return
Insert line above⌘ + Shift + Return
Indent selection⌘ + ]
Outdent selection⌘ + [
Expand code folding⌘ + Option + ]
Collapse code folding⌘ + Option + [
Quick Actions & refactoringOption + Return
Rename symbol⌘ + R, R

Debugging (Mac)

ActionMac Shortcut
Start / continue debugging⌘ + Return
Start without debugging⌘ + Option + Return
Stop debuggingShift + ⌘ + Return
Toggle breakpoint⌘ + \
Step overF6
Step intoF7
Step outShift + F7
Run to cursor⌘ + F10
Build solution⌘ + B
Rebuild solution⌘ + Shift + B

IntelliSense (Mac)

ActionMac Shortcut
Trigger completionOption + Esc
Show parameter info⌘ + Shift + Space
Quick info⌘ + Option + Space

VS 2022 vs VS 2019: what changed

Most shortcuts are identical between VS 2022 and VS 2019. The differences come primarily from new features added in 2022 and later.

Feature / ShortcutVS 2019VS 2022Status
Build solutionCtrl + Shift + BCtrl + Shift + BUnchanged
Go to DefinitionF12F12Unchanged
GitHub Copilot suggestionsNot availableAlt + \ (inline) / Alt + . (next suggestion)New in VS 2022
GitHub Copilot ChatNot availableCtrl + \, Ctrl + CNew in VS 2022 (17.6+)
Hot Reload (apply code changes)Limited (Edit & Continue)Alt + F10Enhanced in VS 2022
Duplicate lineCtrl + E, VCtrl + D (also available) or Ctrl + E, VAdded shortcut alias
Search Everything (VS Search)Ctrl+Q (Feature Search)Ctrl + Q (enhanced, searches docs & settings too)Improved in VS 2022
Collapse to definitionsCtrl + M, OCtrl + M, OUnchanged
Work items (Team Explorer)Opens in VS IDEOpens in web browserDeprecated in IDE

Important for VS 2022 users
If you have GitHub Copilot enabled, Alt + \ triggers an inline code suggestion at your cursor. Alt + ] cycles to the next suggestion and Tab accepts it. This is one of the highest-value new shortcuts in VS 2022.

Read More: Best Visual Studio Alternatives & Competitors

How to customize Visual Studio keyboard shortcuts

Every shortcut in Visual Studio can be changed, removed, or reassigned. Here’s how to do it in 5 steps.

  1. Open Visual Studio and go to Tools in the top menu bar.
  2. Click Options to open the Options dialog.
  3. In the left pane, expand Environment and click Keyboard.
  4. In the “Show commands containing” box, type part of the command name you want to remap (e.g. type Build.BuildSolution to find the build shortcut).
  5. Select the command, click in the “Press shortcut keys” box, press your desired new key combination, then click Assign.

Frequently asked questions

What is the shortcut to start debugging in Visual Studio?

Press F5 to start debugging in Visual Studio (Windows). This builds your project and launches it with the debugger attached. To run without the debugger (faster), use Ctrl + F5. On Visual Studio for Mac, the equivalent is ⌘ + Return.

How do I comment out code in Visual Studio?

Select the lines you want to comment, then press Ctrl + K, C to comment and Ctrl + K, U to uncomment. On Mac, use ⌘ + / to toggle comments. These shortcuts work in C#, VB.NET, C++, and most other languages supported by Visual Studio.

How do I rename a variable across all files in Visual Studio?

Place your cursor on any variable, method, or class name and press Ctrl + R, R. This opens the Rename refactoring dialog, which lets you preview and apply the rename across every file in your entire solution including comments and string references if you choose. It is the safest way to rename in VS as it uses Roslyn’s semantic understanding of your code, not just text search.

What is the shortcut to go to a specific line number in Visual Studio?

Press Ctrl + G to open the Go To Line dialog. Type the line number and press Enter. On Visual Studio for Mac, use ⌘ + L.

Can I customize keyboard shortcuts in Visual Studio?

Yes. Go to Tools → Options → Environment → Keyboard. Search for any command by name, select it, press your desired key combination in the “Press shortcut keys” field, and click Assign. You can also export your custom shortcuts as a .vssettings file and import them on other machines or share with your team.

Are Visual Studio shortcuts the same as Visual Studio Code shortcuts?

No Visual Studio (the full IDE) and Visual Studio Code (a lightweight editor) are different products with different default keyboard shortcuts. Many common shortcuts overlap (e.g. F5 for debug, Ctrl + Shift + F for find in files), but the systems are distinct. VS Code uses a JSON-based keybinding system; Visual Studio uses profiles configured via Tools → Options → Keyboard.

What are the most important Visual Studio shortcuts to learn first?

If you’re just starting, learn these five first they cover around 80% of daily development activity: F12 (Go to Definition), F5 (Start Debugging), Ctrl + Shift + B (Build Solution), Ctrl + . (Quick Actions), and Ctrl + K, C / U (Comment / Uncomment). Once these are in muscle memory, add Ctrl + R, R (Rename) and Ctrl + , (Go to All).

How do I build a project in Visual Studio using the keyboard?

Press Ctrl + Shift + B to build the entire solution (compiles only changed files). Use F6 as an alternative. To do a full clean rebuild, use Ctrl + Alt + F7. To cancel a running build, press Ctrl + Break.

Conclusion

Keyboard shortcuts in Visual Studio are not just about speed they keep you in flow. Every mouse reach breaks your mental model of the code you’re working in. The shortcuts in this guide are organized by the tasks you actually perform, so you can adopt them incrementally: start with the top 10 in the Quick Answer box at the top, get those into muscle memory over a week, then layer in navigation and refactoring shortcuts next.

If your shortcuts are behaving differently from what’s listed here, check your active keyboard profile under Tools → Options → Environment → Keyboard — you may be on a Visual C# or Visual Basic profile rather than the General profile used in this guide.

READ NEXT:

Pratik

Pratik is the founder of Tutorial Tactic and a productivity tools specialist with 15 years of hands-on experience in Google Workspace, Microsoft Office, and software automation. He has published over 1,500 guides on keyboard shortcuts, software commands, how-to tutorials and workflow optimization, helping readers across the US and India work faster with the tools they use every day. Tutorial Tactic was founded in 2021 with one goal: cut through the noise and give readers exactly what they need fast, verified, and beginner-friendly.
Back to top button