Select the code and press Ctrl-K-S to display a context menu where you can select a snippet.įind matching braces (C#): For C# development it can be a little annoying trying to find the closing brace "}" to the open one. Surround code with snippet: Like the Tab key above for creating a snippet, you can surround a section of code with a snippet. You can do these for other code blocks like try-catch, for, class, for each, etc. In C#, instead of making sure you have brackets for if-conditions, simply type if and press the Tab key twice. Tab key for "snippets": This is a very useful shortcut that you should use a lot. Ctrl-M-H and Ctrl-M-U.Ĭomment/uncomment code: Instead of adding "//" to every line you can comment/uncomment blocks of code. In the video below, we'll go through this list of helpful shortcuts that are found under the Edit menu:Ĭollapse/expand selection of code: When you want to hide code that is blocking or distracting your view.
You can reference all of these shortcuts under each main menu item. Visual Studio has it's own library of shortcuts that can save you time by making you less dependent on your mouse. You are familiar with some common shortcuts on Windows like Ctrl-X for cut, Ctrl-C for copy, and Ctrl-V for paste. As you already know, keyboard shortcuts are standard for all computer software.