Using the keyboard instead of the mouse really helps a lot to improve coding speed and Visual Studio has provided many great features with keyboard shortcuts, along with providing functions to add our own shortcuts by just following a few steps.
The "//" sign is used to add comments.
| Window Management | |
| Open solution | Ctrl+Shift+O //open window to navigate to the path to select a solution from drive to open |
| Search in Solution Explorer | Ctrl+; //allow search items in the solution explorer |
| Add New Project | Ctrl+Shift+N //open window to select new Project to add |
| Open Properties window | F4 or Alt+Enter |
| Open Immediate window | Ctrl+Alt+I |
| Build | Ctrl+Shift+B |
| Run | F5 |
| Restart | Ctrl+Shift+F5 |
| Add Watch | Ctrl+Alt+W |
| Quick Watch | Shift+F9 or Ctrl+Alt+Q |
| Rename | F2 //rename any file in VS solution |
| Close Current item | Ctrl+F4 |
| Close All the document | Ctrl+W // close all the documents which are opened; if it does not work, add own shortcut |
| Navigate to the previously opened file | Ctrl+tab or Ctrl+Alt+ Down Arrow |
| Search in files | Ctrl+Shift+F |
| Replace in files | Ctrl+Shift+H |
| Navigate | Ctrl+, |
| Editor Management | |
| Add New File | Ctrl+N |
| Add New Item | Ctrl+Shift+A |
| Add Existing Item | Alt+Shift+A |
| Save All | Ctrl+Shift+S |
| Save current item | Ctrl+S |
| Add class | Type cl + tab tab |
| Add constructor | Type ctro + tab tab same for other prop, if, for, intr, foreach, try etc. //very usefull to add new proerty, method, constructor, class, if else, try catch. just type 2-3 charactors and it will generate whoe syntax. |
| Multi line edit / vertical typing | Hold Alt+Shift and move up/down/left/right |
| Comment | Ctrl+K+C //just select the code and press the keys |
| Remove comment | Ctrl+K+U |
| Quick fix | Ctrl+. |
| Code Snippet | Ctrl+K+X and choose |
| Surround with | Ctrl+K+S |
| Move line up/down | Up: ALT + ↑ Down: ALT + ↓ |
| Cut / Delete line | Cut: Ctrl +L Delete: Ctrl+Shift+L //cut or delete line without selecting just place the cursor and press the keys |
| Collapse All | C#: Ctrl+M+O Current Method: Ctrl+M+M Ctrl+M+A (HTML also) |
| Expand All | Ctrl+M+L |
| Add/Remove Break Point | F9 |
| Delete all break point | Ctrl +Shift+f9 |
| Format code | Ctrl +K+D |
| Got to definition | F12 |
| Go to implementation | Ctrl+F12 |
| Peek definition | Alt+F12 |
| Find reference | Shift+F12 |
| Navigate backward | Ctrl + - |
| Navigate forward | Ctrl + Shift + - |
Find a complete list for all the shortcuts here: visual studio keyboard shortcut
Add shortcuts
If any shortcut does not work then a new shortcut can be defined in Visual Studio. Follow the below steps to define shortcuts.
Go to Tool > option: The following window will appear.



Rushikesh RautPosted Sep 14, 2022, 4:36 PM
Very helpful.Thank you.
Hrides ThakurPosted Apr 8, 2019, 7:45 AM
It is realy helpful blog, I took print and sticked in front of my desk. Thanks for sharing
Laxmidhar SahooPosted Apr 8, 2019, 12:32 AM
This is helpful to all
Abhay SharmaPosted Apr 3, 2019, 1:29 PM
Good job....:)