Visual Studio keyboard shortcuts
Visual Studio is Microsoft's full IDE for .NET and C++ work on Windows, separate from the lighter VS Code. Its default General profile keys build and debug, edit and navigate code, manage files and projects, and refactor.
Windows · 78 shortcutsBuild and debug
Build the solution, start or stop debugging, set breakpoints, and step through code from the Visual Studio IDE.
| Action | Shortcuts |
|---|---|
| Build the solution | Ctrl + Shift + B |
| Cancel the build | Ctrl + Break |
| Compile | Ctrl + F7 |
| Set a function breakpoint | Ctrl + B |
| Break all | Ctrl + Alt + Break |
| Delete all breakpoints | Ctrl + Shift + F9 |
| Open Exceptions | Ctrl + Alt + E |
| Open Quick WatchShift+F9 also works. | Ctrl + Alt + Q |
| Restart debugging | Ctrl + Shift + F5 |
| Run to cursor | Ctrl + F10 |
| Set the next statement | Ctrl + Shift + F10 |
| Start debugging | F5 |
| Start without debugging | Ctrl + F5 |
| Step into | F11 |
| Step out | Shift + F11 |
| Step over | F10 |
| Stop debugging | Shift + F5 |
| Toggle a breakpoint | F9 |
Editing and navigation
Complete code, format and comment selections, search the solution, navigate symbols, and manage editor text.
| Action | Shortcuts |
|---|---|
| Break the line | Enter |
| Collapse to definitions | Ctrl + M then Ctrl + O |
| Comment the selection | Ctrl + K then Ctrl + C |
| Complete the current wordAlt+Right Arrow also works. | Ctrl + Space |
| CopyCtrl+Insert also works. | Ctrl + C |
| CutShift+Delete also works. | Ctrl + X |
| Find | Ctrl + F |
| Find all references | Shift + F12 |
| Find in files | Ctrl + Shift + F |
| Find the next match | F3 |
| Format the document | Ctrl + K then Ctrl + D |
| Format the selection | Ctrl + K then Ctrl + F |
| Go to a line | Ctrl + G |
| Go to declaration | Ctrl + F12 |
| Go to definition | F12 |
| Focus the Find combo | Ctrl + D |
| Go to the next location | F8 |
| Insert a snippet | Ctrl + K then Ctrl + X |
| List members | Ctrl + J |
| Navigate to a file, type, or symbolCtrl+Comma and Ctrl+T also work. | Ctrl + P |
| Open a file under the cursor | Ctrl + Shift + G |
| Show parameter information | Ctrl + Shift + Space |
| PasteShift+Insert also works. | Ctrl + V |
| Peek the definition | Alt + F12 |
| RedoCtrl+Shift+Z and Shift+Alt+Backspace also work. | Ctrl + Y |
| Replace | Ctrl + H |
| Select all | Ctrl + A |
| Toggle a line commentNeeds Visual Studio 2022 version 17.11 or later. Ctrl+K, Ctrl+/ also works. | Ctrl + / |
| UndoAlt+Backspace also works. | Ctrl + Z |
| Delete the word to the right | Ctrl + Delete |
| Delete the word to the left | Ctrl + Backspace |
Files, projects, and views
Create or open files and projects, save work, inspect solution tools, and move through Visual Studio document windows.
| Action | Shortcuts |
|---|---|
| Exit Visual Studio | Alt + F4 |
| Create a new file | Ctrl + N |
| Create a new project | Ctrl + Shift + N |
| Open a file | Ctrl + O |
| Open a project | Ctrl + Shift + O |
| Save all | Ctrl + Shift + S |
| Save selected items | Ctrl + S |
| Open Class View | Ctrl + Shift + C |
| Open Error List | Ctrl + \ then Ctrl + E |
| Navigate backward | Ctrl + - |
| Navigate forward | Ctrl + Shift + - |
| Open Object Browser | Ctrl + Alt + J |
| Open Output | Ctrl + Alt + O |
| Open the Properties window | F4 |
| Open Solution Explorer | Ctrl + Alt + L |
| Open Toolbox | Ctrl + Alt + X |
| View codeIn the Settings Designer. | F7 |
| View designerIn the HTML Editor Source View. | Shift + F7 |
| Activate the document window | Esc |
| Close the document windowCtrl+F4 also works. | Ctrl + W |
| Activate the next document window | Ctrl + F6 |
| Open document window navigation | Ctrl + Tab |
| Move to the next split pane | F6 |
Project and refactoring
Add project items, attach to a process, and use common refactoring commands.
| Action | Shortcuts |
|---|---|
| Add an existing item | Shift + Alt + A |
| Add a new item | Ctrl + Shift + A |
| Extract a method | Ctrl + R then Ctrl + M |
| Attach to a process | Ctrl + Alt + P |
| Remove and sort usings | Ctrl + R then Ctrl + G |
| Surround withVisual Studio 2019 and earlier only. | Ctrl + K then Ctrl + S |
Source
official Visual Studio default keyboard shortcuts · Checked
Visual Studio's General profile. Other profiles, keyboard layouts, language settings, and your own changes can assign different keys.