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.
| Action | Windows Shortcut | Notes |
|---|---|---|
| Create new project | Ctrl + Shift + N | Opens New Project dialog |
| Open file | Ctrl + O | |
| Open project / solution | Ctrl + Shift + O | |
| Save current file | Ctrl + S | |
| Save all files | Ctrl + Shift + S | Recommended habit before builds |
| Undo | Ctrl + Z | |
| Redo | Ctrl + Shift + Z | |
| Cut | Ctrl + X | Cuts entire line if nothing selected |
| Copy | Ctrl + C | |
| Paste | Ctrl + V | |
| Paste from clipboard ring | Ctrl + Shift + V | Cycles through clipboard history |
| Select all | Ctrl + A | |
| Ctrl + P | ||
| Full-screen mode | Shift + Alt + Enter | Toggle IDE full screen |
| Close current tab | Ctrl + F4 | |
| Go to next document | Ctrl + F6 | |
| Go to previous document | Ctrl + Shift + F6 | |
| Rename | F2 | In Solution Explorer context |
| Add new item to project | Ctrl + Shift + A | |
| Close dialog / menu | Esc |
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
| Action | Windows Shortcut | Notes |
|---|---|---|
| Go to Definition | F12 | Jumps to where a symbol is defined the single most-used navigation shortcut in VS |
| Go to Declaration / Implementation | Ctrl + F12 | Navigates to the implementation, not just the interface |
| Peek Definition (inline preview) | Alt + F12 | Opens definition in an inline window stay in your current file |
| Find All References | Shift + F12 | Shows 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 backward | Ctrl + – | Jump back to previous cursor location |
| Navigate forward | Ctrl + Shift + – | |
| Cycle through open files | Ctrl + Tab | Shows all open documents in a switcher |
| Go to line number | Ctrl + G | Opens Go To Line dialog |
| Go to matching brace | Ctrl + ] | Jumps between opening and closing braces |
| Find Symbol | Alt + F12 | |
| Display Navigate To | Ctrl + , |
Cursor and selection movement
| Action | Windows Shortcut |
|---|---|
| Move one word right | Ctrl + → |
| Move one word left | Ctrl + ← |
| Jump to next occurrence of highlighted symbol | Ctrl + Shift + ↓ |
| Jump to previous occurrence of highlighted symbol | Ctrl + Shift + ↑ |
| Extend selection to end of line | Shift + End |
| Extend selection to start of line | Shift + Home |
| Extend selection to end of document | Ctrl + Shift + End |
| Extend selection to start of document | Ctrl + Shift + Home |
| Extend selection one word right | Ctrl + Shift + → |
| Extend selection one word left | Ctrl + Shift + ← |
| Select current word | Ctrl + W |
| Extend selection down one page | Shift + Page Down |
| Extend selection up one page | Shift + Page Up |
| Extend selection to matching brace | Ctrl + Shift + ] |
Code editing shortcuts
These shortcuts handle the tasks you perform hundreds of times per session formatting, commenting, deleting, and rearranging lines.
| Action | Windows Shortcut | Notes |
|---|---|---|
| Comment selected code | Ctrl + K, C | Adds // to each selected line |
| Uncomment selected code | Ctrl + K, U | Removes // from each selected line |
| Format document | Ctrl + K, D | Applies your code formatting settings to entire file |
| Format selection | Ctrl + K, F | Formats only the selected code |
| Delete current line | Ctrl + L | Deletes the entire line and moves cursor up |
| Duplicate line | Ctrl + E, V | Copies current line below without clipboard |
| Delete word to the right of cursor | Ctrl + Delete | |
| Delete word to the left of cursor | Ctrl + Backspace | |
| Insert blank line above cursor | Ctrl + Enter | |
| Insert blank line below cursor | Ctrl + Shift + Enter | |
| Make selection uppercase | Ctrl + Shift + U | |
| Make selection lowercase | Ctrl + U | |
| Collapse / expand current region | Ctrl + M, M | Toggle outlining on current block |
| Collapse all regions | Ctrl + M, A | |
| Expand all regions | Ctrl + M, X | |
| Hide current selection | Ctrl + M, H | Collapses custom-selected code |
| Collapse declaration bodies | Ctrl + M, O | |
| Visualise whitespace | Ctrl + Shift + 8 | Toggle whitespace visibility |
| Remove whitespace and tabs in selection | Ctrl + K, \ | |
| Incremental search | Ctrl + I | Search as you type, forward |
| Reverse incremental search | Ctrl + Shift + I | Search as you type, backward |
| Display parameter info for method | Ctrl + Shift + Space | Shows required parameters for the current method call |
| Display symbol declaration | Ctrl + F12 | |
| Display symbol definition | F12 |
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.
| Action | Windows Shortcut | Notes |
|---|---|---|
| Quick Actions & refactorings | Ctrl + . | The most powerful shortcut in VS shows all available code actions, fixes, and refactoring suggestions at cursor |
| Rename symbol | Ctrl + R, R | Renames a variable, method, or class and updates all references across the entire solution |
| Extract method | Ctrl + R, M | Extracts selected code into a new method |
| Encapsulate field | Ctrl + R, E | Wraps a field in a property with getter/setter |
| Remove and sort usings | Ctrl + R, G | Cleans up unnecessary using statements |
| Generate method stub | Ctrl + K, M | |
| Surround with snippet | Ctrl + K, S | Wraps selected code in a try/catch, if, foreach, etc. |
| Insert snippet | Ctrl + K, X | Opens 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.
| Action | Windows Shortcut | Notes |
|---|---|---|
| Trigger IntelliSense completion list | Ctrl + Space | Brings back the completion list if it was dismissed |
| Open completion list (alternate) | Ctrl + J | |
| Show parameter info | Ctrl + Shift + Space | Displays the signature and parameter types for the current method |
| Toggle completion / suggestion mode | Ctrl + Alt + Space | Switches between full completion and suggestion-only mode |
| Quick info tooltip | Hover or Ctrl + K, I | Shows full type info for symbol under cursor |
| Complete word from list | Ctrl + Space | Auto-completes the current word |
| Expand code snippet | Type prefix then Tab + Tab | E.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
| Action | Windows Shortcut | Notes |
|---|---|---|
| Start debugging | F5 | Builds and runs with debugger attached |
| Start without debugging | Ctrl + F5 | Runs the app without attaching the debugger faster startup |
| Stop debugging | Shift + F5 | Terminates the debugging session |
| Restart debugging | Ctrl + Shift + F5 | Stops and immediately restarts the debugger |
| Attach to process | Ctrl + Alt + P | Opens Attach to Process dialog |
Breakpoints
| Action | Windows Shortcut | Notes |
|---|---|---|
| Toggle breakpoint | F9 | Sets or removes a breakpoint on the current line |
| Insert new function breakpoint | Ctrl + B | Break on entry to a named function |
| Enable / disable breakpoint | Ctrl + F9 | Toggles breakpoint without removing it |
| Delete all breakpoints | Ctrl + Shift + F9 | Use with caution |
| Run to cursor | Ctrl + F10 | Runs to the line where cursor sits temporary breakpoint |
Stepping through code
| Action | Windows Shortcut | Notes |
|---|---|---|
| Step over | F10 | Executes current line; if it’s a function call, runs the whole function |
| Step into | F11 | Executes current line; if it’s a function call, steps inside it |
| Step out | Shift + F11 | Runs the rest of the current function and returns to the caller |
| Set next statement | Ctrl + Shift + F10 | Changes which line will execute next powerful for re-running logic |
| Show next statement | Alt + * | Highlights the next line to be executed |
| Toggle disassembly / user code view | Ctrl + F11 |
Watch windows and inspection
| Action | Windows Shortcut | Notes |
|---|---|---|
| Show QuickWatch window | Ctrl + Alt + Q | Evaluate an expression or inspect a variable value |
| Show Exceptions dialog | Ctrl + Alt + E | Configure which exceptions break the debugger |
| Show Output window | Ctrl + Shift + O | |
| Show Error List | Ctrl + \, E | |
| Show Call Stack window | Ctrl + Alt + C | |
| Show Locals window | Ctrl + 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
| Action | Windows Shortcut | Notes |
|---|---|---|
| Build solution | Ctrl + Shift + B | Compiles only files that have changed since last build |
| Build solution (alternate) | F6 | |
| Rebuild solution | Ctrl + Alt + F7 | Clean + full build use when build cache is stale |
| Cancel build | Ctrl + Break | Stops a running build immediately |
| Show Error List | Ctrl + \, E | Opens error list after build |
Search & replace shortcuts
| Action | Windows Shortcut | Notes |
|---|---|---|
| Find (in current file) | Ctrl + F | |
| Find next | F3 | |
| Find previous | Shift + F3 | |
| Find next in selected text | Ctrl + F3 | |
| Find previous in selected text | Ctrl + Shift + F3 | |
| Find in files (solution-wide) | Ctrl + Shift + F | Searches across all files in solution |
| Replace (in current file) | Ctrl + H | |
| Replace in files (solution-wide) | Ctrl + Shift + H | |
| Find All References for symbol | Shift + F12 | |
| Find symbol | Alt + F12 | |
| Put cursor in Find / Command box | Ctrl + D | |
| Quick find symbol | Shift + 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.
| Action | Windows Shortcut |
|---|---|
| Toggle bookmark on current line | Ctrl + K, K |
| Go to next bookmark | Ctrl + K, N |
| Go to previous bookmark | Ctrl + K, P |
| Go to next bookmark in folder | Ctrl + Shift + K, N |
| Go to previous bookmark in folder | Ctrl + Shift + K, P |
| Focus on Bookmark window | Ctrl + K, W |
| Toggle code shortcut on current line | Ctrl + K, H |
| Clear all bookmarks | Ctrl + 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 trigger | Expands to | Language |
|---|---|---|
| prop + Tab Tab | Auto-implemented property | C# |
| propfull + Tab Tab | Full property with backing field | C# |
| ctor + Tab Tab | Constructor | C# |
| for + Tab Tab | for loop | C#, VB |
| foreach + Tab Tab | foreach loop | C# |
| while + Tab Tab | while loop | C#, VB |
| do + Tab Tab | do…while loop | C# |
| if + Tab Tab | if block | C#, VB |
| else + Tab Tab | else block | C# |
| switch + Tab Tab | switch statement | C# |
| try + Tab Tab | try/catch block | C# |
| tryf + Tab Tab | try/finally block | C# |
| class + Tab Tab | Class declaration | C# |
| interface + Tab Tab | Interface declaration | C# |
| enum + Tab Tab | Enum declaration | C# |
| svm + Tab Tab | static void Main block | C# |
| cw + Tab Tab | Console.WriteLine() | C# |
| lock + Tab Tab | lock block | C# |
| using + Tab Tab | using statement (IDisposable) | C# |
| Action | Windows Shortcut | Notes |
|---|---|---|
| Insert snippet at cursor | Ctrl + K, X | Opens snippet picker |
| Surround selected code with snippet | Ctrl + K, S | Wraps selection in try/catch, if, foreach, etc. |
| Open Code Snippet Manager | Ctrl + K, B | Browse and manage all available snippets |
Window & tool management shortcuts
| Action | Windows Shortcut | Notes |
|---|---|---|
| Open Solution Explorer | Ctrl + Shift + L | |
| Open Class View | Ctrl + Shift + C | |
| Open Command window | Ctrl + Alt + A | Run VS commands directly |
| Open Output window | Ctrl + Shift + O | |
| Open Server Explorer | Ctrl + Alt + S | |
| Open Resource View | Ctrl + Shift + E | |
| Open Call Hierarchy window | Ctrl + Alt + K | See all callers and callees of a method |
| Open Bookmark window | Ctrl + K, W | |
| Open Macro IDE | Alt + F11 | |
| Close Find & Replace window | Shift + Esc | |
| Open Code Snippet Manager | Ctrl + K, B | |
| Go to next window | Ctrl + F6 | |
| Go to previous window | Ctrl + 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)
| Action | Mac 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)
| Action | Mac 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)
| Action | Mac Shortcut |
|---|---|
| Comment / uncomment line or selection | ⌘ + / |
| Format document | ⌘ + Option + F |
| Delete line | ⌘ + Shift + K |
| Duplicate line | ⌘ + D |
| Move line up | Option + ↑ |
| Move line down | Option + ↓ |
| Insert line below | ⌘ + Return |
| Insert line above | ⌘ + Shift + Return |
| Indent selection | ⌘ + ] |
| Outdent selection | ⌘ + [ |
| Expand code folding | ⌘ + Option + ] |
| Collapse code folding | ⌘ + Option + [ |
| Quick Actions & refactoring | Option + Return |
| Rename symbol | ⌘ + R, R |
Debugging (Mac)
| Action | Mac Shortcut |
|---|---|
| Start / continue debugging | ⌘ + Return |
| Start without debugging | ⌘ + Option + Return |
| Stop debugging | Shift + ⌘ + Return |
| Toggle breakpoint | ⌘ + \ |
| Step over | F6 |
| Step into | F7 |
| Step out | Shift + F7 |
| Run to cursor | ⌘ + F10 |
| Build solution | ⌘ + B |
| Rebuild solution | ⌘ + Shift + B |
IntelliSense (Mac)
| Action | Mac Shortcut |
|---|---|
| Trigger completion | Option + 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 / Shortcut | VS 2019 | VS 2022 | Status |
|---|---|---|---|
| Build solution | Ctrl + Shift + B | Ctrl + Shift + B | Unchanged |
| Go to Definition | F12 | F12 | Unchanged |
| GitHub Copilot suggestions | Not available | Alt + \ (inline) / Alt + . (next suggestion) | New in VS 2022 |
| GitHub Copilot Chat | Not available | Ctrl + \, Ctrl + C | New in VS 2022 (17.6+) |
| Hot Reload (apply code changes) | Limited (Edit & Continue) | Alt + F10 | Enhanced in VS 2022 |
| Duplicate line | Ctrl + E, V | Ctrl + D (also available) or Ctrl + E, V | Added shortcut alias |
| Search Everything (VS Search) | Ctrl+Q (Feature Search) | Ctrl + Q (enhanced, searches docs & settings too) | Improved in VS 2022 |
| Collapse to definitions | Ctrl + M, O | Ctrl + M, O | Unchanged |
| Work items (Team Explorer) | Opens in VS IDE | Opens in web browser | Deprecated 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.
- Open Visual Studio and go to Tools in the top menu bar.
- Click Options to open the Options dialog.
- In the left pane, expand Environment and click Keyboard.
- 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).
- 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:





