Visual Studio 2019 shortcuts
Quickly add public properties
You can add properties to your classes the quick way by typing prop and then tab tab
In this case were going to make a property and name it hitPoints
Quickly populate a full property with public and private members
you can do the exact same thing except type propfull to get the full property
public int MyProperty { get { return myVar; } set { myVar = value; } }
Quickly add a new class to your project
CTRL + Shift + A
Go to the definition of any object
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.
F12
Move lines up and down in the editor
You can move lines just by pressing
Alt + up/down arrows.
You can also Shift-Select a bunch of lines and then Alt-Arrow them around as a group.
Quickly Launch a new project or search your solution , add a class and lots of other stuff.
Most of the things that you use in the menus, you know, when you open the menu Tools>Options and then just start until you find whatever you are looking for..
CTRL + Q
Quickly populate Console.WriteLine()
Type
CW TAB TAB
Quickly populate an IF statement, for loop , foreach loop , do , while, enums and others
This works for many of the common things we do in Visual Studio
Type any of the above keywords and TAB TAB
There are probably some others that I missed. (let me know in the comments!)
Open Quick actions and Refactoring (from here we can do a whole host of things)
CTRL + .
(control key + the period)
Quickly Navigate to... well anything
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
Press CTRL +, and start typing.
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)
Quickly search your solution explorer
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.
CTRL + ;
Quickly run an automated test
if you are using automated testing you can run a test from the keyboard by pressing
CTRL + R , T
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 TheDevelopingDeveloper.net and subscribe for updates!
Top comments (3)
Great list! Thanks.
There are some pretty great time savers in VS ! :)
Whipped this up last night and this morning. Some of these I just learned last night and holy crow was I missing out!