12 tips, tricks, and  Visual Studio 2019 shortcuts to increase efficiency  - Part 1
Tags: visualstudio, beginners, dotnet, productivity
Published: 2020-02-07 15:03:38

<img class="aligncenter size-full wp-image-903" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/images.png" alt="" width="300" height="168" />
<h1 style="text-align: center;">Visual Studio 2019 shortcuts</h1>
<h3></h3>
<h3>Quickly add public properties</h3>
<p style="padding-left: 40px;">You can add properties to your classes the quick way by typing <strong>prop</strong> and then tab tab</p>
<p style="padding-left: 40px;">In this case were going to make a property and name it hitPoints</p>
<p style="padding-left: 40px;"><img class="wp-image-888 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/894F3941-EAC2-4F0A-8A45-19EBD8D57D47.gif" alt="example of creating property" width="367" height="296" /></p>
&nbsp;

&nbsp;
<h3>Quickly populate a full property with public and private members</h3>
<p style="padding-left: 40px;">you can do the exact same thing except type <strong>propfull</strong> to get the full property</p>

<pre>public int MyProperty
{
    get { return myVar; }
    set { myVar = value; }
}</pre>
<h3>Quickly add a new class to your project</h3>
<code class="EnlighterJSRAW" data-enlighter-language="generic">CTRL + Shift + A</code>

<img class="wp-image-896 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/Snag_f42c4d.png" alt="Example of how to create a class from the keyboard" width="452" height="314" />
<h3></h3>
<h3>Go to the definition of any object</h3>
<p style="padding-left: 40px;">This is a quick way to navigate to the definition that is under your cursor. For bonus points try ALT + F12 which brings up the "peek" dialog for that item. From within that dialog box you can also CTRL click other items to go straight to them.</p>
<code class="EnlighterJSRAW" data-enlighter-language="generic">F12</code>
<h3><img class="wp-image-897 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/1AB1B8FE-6409-4596-9A04-BF180FB28179.gif" alt="example of navigation to property" width="300" height="306" /></h3>
<h3></h3>
<h3>Move lines up and down in the editor</h3>
<h3><span style="color: #82868b; font-family: Lora, serif; font-size: 1rem;">You can move lines just by pressing</span></h3>
<code class="EnlighterJSRAW" data-enlighter-language="generic"><span style="color: #82868b; font-family: Lora, serif; font-size: 1rem;">Alt + up/down arrows. </span></code>

You can also Shift-Select a bunch of lines and then Alt-Arrow them around as a group.
<h3><img class="wp-image-893 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/6C334A20-9091-4345-A4D7-16F5292C9701.gif" alt="Example of moving text in the Visual Studio editor" width="358" height="218" /></h3>
&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;
<h3>Quickly Launch a new project or search your solution , add a class and lots of other stuff.</h3>
Most of the things that you use in the menus, you know, when you open the menu Tools&gt;Options and then just start until you find whatever you are looking for..

<code class="EnlighterJSRAW" data-enlighter-language="generic">CTRL + Q</code>

<img class="wp-image-898 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/8560C830-1577-42FC-9054-FB035F3A88AC.gif" alt="" width="323" height="180" />
<h3></h3>
<h3>Quickly populate Console.WriteLine()</h3>
Type

<code class="EnlighterJSRAW" data-enlighter-language="generic">CW TAB TAB </code>

<img class="wp-image-899 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/1A08AB9C-F179-46CD-B049-6BEBD53A657F.gif" alt="Example of quick console writeline" width="237" height="236" />
<h3></h3>
<h3>Quickly populate an IF statement, for loop , foreach loop , do , while, enums and others</h3>
This works for many of the common things we do in Visual Studio

<code class="EnlighterJSRAW" data-enlighter-language="generic">Type <span style="color: #2a3235;"><b>any of the above keywords </b></span>and  TAB TAB</code>

There are probably some others that I missed. (let me know in the comments!)

<img class="wp-image-900 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/A7A9F220-20CE-4292-95EB-8C885423A1C8.gif" alt="example of populating loops with tab tab" width="276" height="262" />

&nbsp;

&nbsp;
<h3></h3>
<h3>Open Quick actions and Refactoring (from here we can do a whole host of things)</h3>
<code class="EnlighterJSRAW" data-enlighter-language="generic">CTRL + .</code>

(control key + the period)

<img class="wp-image-901 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/7067F3A2-BE02-4E58-AD5E-250DBA6E1834.gif" alt="example of quick actions and refactoring" width="267" height="263" />
<h3></h3>
<h3>Quickly Navigate to... well anything</h3>
<p align="left">Another useful shortcut to remember is the NavigateTo command  , this command lets you search for class names, files, members, types or even method names. This is super useful when working in a large project with many methods and classes</p>
<code class="EnlighterJSRAW" data-enlighter-language="generic">Press CTRL +, and start typing.</code>

Once you learn this command you will not really even need the Solution Explorer.  As long as you already know the name of the item you want to see.

(Control + comma)
<h3><img class="wp-image-902 alignleft" src="https://www.thedevelopingdeveloper.net/wp-content/uploads/2020/02/C8DE171A-81F0-4AAB-9BA3-2C958F01EE92.gif" alt="Example of quick search" width="658" height="215" /></h3>
<h3></h3>
<h3>Quickly search your solution explorer</h3>
While I don't use this one very much because of the last tip. You CAN use this tip to search explicitly in the solution explorer.

<code class="EnlighterJSRAW" data-enlighter-language="generic">CTRL + ;</code>

&nbsp;
<h3>Quickly run an automated test</h3>
if you are using automated testing you can run a test from the keyboard by pressing

<code class="EnlighterJSRAW" data-enlighter-language="generic">CTRL + R , T</code>

&nbsp;

I really hope these Visual Studio 2019 shortcuts help you as much as they have me. I only recently learned some of these and I sure wish I'd have know them earlier.

If you like this or other posts by me check out the rest of my blog site <a href="https://www.thedevelopingdeveloper.net/">TheDevelopingDeveloper.net</a> and subscribe for updates!
<div id="hzImg" style="border: 1px solid #ffffff; line-height: 0; overflow: hidden; padding: 2px; margin: 0px; position: absolute; z-index: 2147483647; border-radius: 3px; box-shadow: rgba(0, 0, 0, 0.33) 3px 3px 9px 5px; opacity: 1; top: 54px; left: 547px; background-color: #ffffff; cursor: pointer; pointer-events: none; display: none;"></div>