Visual Studio, as one of the most widely-used IDEs, comes packed with shortcuts to make our lives easier. But do we know them all? Or even the most useful ones? Here's a quick cheat sheet of the Visual Studio shortcuts that I use to speed up my coding sessions. No ReSharper needed!
Code Assistance
Alt + Enter
- Code suggestionsCtrl + Shift + Space
- IntelliSense List parameter infoCtrl + Space
- IntelliSense List members
This one actually didn't work in my VS, so I added it manually like explained here.
Running & Debugging
F5
- Start with debuggingCtrl + F5
- Start without debuggingCtrl + Alt + P
- Attach to processCtrl + Shift + P
- Reattach to processF9
- Add/Remove breakpointCtrl + Shift + F9
- Delete all breakpointsF5
- Continue execution from breakpointF10
- Step overF11
- Step intoShift + F11
- Step outAlt + F10
- Apply code changesShift + F5
- Stop debugging
Build
Ctrl + B
- Build projectCtrl + Shift + B
- Rebuild all projects
Search & Navigation
Ctrl + F
- Search current fileCtrl + Shift + F
- Search solutionCtrl + T
- Search and go to files, classes, methods
Editor
Ctrl + L
- Cut line into clipboardCtrl + Enter
- New line above the current line
File Management
Ctrl + Alt + L
- Switch focus to Solution ExplorerCtrl + Tab
- Switch focus back to EditorF2
- Rename file or directoryCtrl + S
- Save focused fileCtrl + Shift + S
- Save all
Project Management
Ctrl + Shift + A
- Add new item
Pro tip: You can add directories from this menu by typing the path you want the item to be placed. E.g.:My/Custom/Path/MyClass.cs
ctrl + shift + D
- Create New Project Folder
This one actually didn't work in my VS, so I added it manually like this: Go toTools
→Options
→Environment
→Keyboard
→ selectProject.NewFolder
and assign a shortcut. I selectedCtrl + Shift + D
. Select Solution Explorer in the drop-down list and click assign. You can find a more detailed explanation here.
I hope this cheat sheet helps you navigate Visual Studio more efficiently. If you've got more shortcuts that you swear by, do share in the comments! Happy coding! 🚀