Visual Studio Keyboard Shortcuts (Part 1)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys so let's talk some productivity tips and keyboard shortcuts in Visual Studio 2017 I'll be using the Community Edition that's the free version and I hold a lot of courses and I'm used to not using any of those extensions such as resharper just to make the students experience match up with mine if you've been using one of those plugins you might find it interesting that a lot of that stuff comes right out of the box these days in Visual Studio and I'll be doing a separate video on debugging just to keep them both kind of snappy so alright let's get into it all right so the first keyboard shortcut I'd like to look at is ctrl Q for opening the quick launch so if you type ctrl Q I can zoom in for us we see up in the upper right corner here it says quick launch and here we can basically type whatever we want to do so this is like an indexed list of every feature available in Visual Studio so if we want to change the color theme we'll just type theme the first entry seems about right so I'll hit enter that takes us to the correct place in options for switching color themes so this is like a really nice feature because let's say we want to do look at the next keyboard shortcut here which is ctrl shift a so if we've forgotten about that shortcut we can just go ctrl Q and the Q the shortcut is for adding a new item so I'll just type add new item and it says add new item that's ctrl shift a so let's add a new clause here let's call it the person and now that we're in the class here we want to get rid of some of these distracting windows so let's go full screen so it's a little convoluted shortcut but it's shift alt enter so shift alt enters toggles between full screen and not full screen and here if yeah if you're new to Visual Studio you might not knew about but know about properties or sorry snippets so snippets are great it's just like a little code snippet prepared for us so we do we don't have to type all this the basic syntax all the time so prop I hit tab twice it generates a property for me so I can hit tab and I'll go from yeah maybe I say string tab tab name and do another one tab age and snippets are there's tons of them about so let's say I want the constructor let's say I want the for loop in that constructor let's say I wanted to loop with the ten just hit enter to leave snippet mode CW for console.writeline something like that so there's so much so many awesome snippets so whenever you're wondering what snippets are available easiest things are just the type you can always go ctrl K X as well and it will show your list of all the snippets but basically just look for just start to type whatever you're looking for in it it'll show up okie-dokie so let's talk some navigation here so if I hit the control tab without releasing the control key I get this little list so that's window standard right so you can control tab between all your open tabs and let's say I create an instance of that class here in program so I'll go our person equals new person and I'll use the initialization syntax here by the way if you don't you're not getting the intelligence here just go control space control spaces for like show me the intelligence now and I'll just enter my name here in my age a third d9 and now let's say I want to navigate to this person class so I'll just put the carrot over the person and boom f12 is basically go to definition so just put the cursor wherever you want to go hit f12 and it'll take you to that definition yeah if I want to go back now so they have the there are is a beautiful feature in Visual Studio where you can go just like a browser you can go back and forth so control - will take you back and the cursor will be exactly where you left it ctrl shift - will take you forward so those are really amazingly simple ways to navigate and well worth checking out of course this the f12 feature go to definition works great on members as well so I hit on H it takes me to H it's worth noting that if I go to a you know string something that I haven't defined so string is something that might just have defined and I f12 into that one now we get basically an interesting what get some metadata of string here so we can see that it's a sealed clause and we can see all the interfaces that it's implements control - again just to go back I'm going to access let's say the name property again here so I'll add let's add a an exclamation mark there so now I have two two calls to name here and if I want to see everywhere in my application where name is used I can just put the cursor or name and go ctrl K R and then I release control so basically now we have a list here showing us all the the hits so we can double-click on them and see where that takes us if your list looks a little different here it's because you can change the grouping here so I prefer the definition only view and here's a little gem in visual studio if you want to whenever you have a list and one of them is you know you want to go from one of the items to the next one just hit f8 and it will basically takes you through the whole list you can also go shift f8 and it will take you back to the previous item works beautiful even with errors if you have compile time errors you know whatever whatever it is that you have in this list it's it's really really nice tip okie dokie so another something that I use a lot in big files and you know when you have these hotspots like you might have a a method over in Class A and a property over in Class B and you want to be able to navigate between them just really snappy that's bookmarks so let's say I hit a bookmark here on the cross definition of a person so control KK I'm going to pray someplace another one a name control KK and another one on the last bracket here in this file so now we have three of them so control B n if we type that we can see that it takes us through all these so I'm having controlled I haven't never release in control here I have it pressed all the time BP takes us to the previous b and takes us to the next one so the B is for bookmark and the N is for next or B P is for bookmark previous bookmark next book my previous so of course there's a lot more handy when we use them across different files control KK to get rid of them toggle them all right so let's have a look at some copy paste functionality because there's a lot of copy/paste functionality that people a lot of people don't know about so let's say I want to copy this line here person name plus equals exclamation mark so of course I'm a programmer and I'm too lazy to go something like this so I'll just put the cursor anywhere on the line hit ctrl C hit ctrl V so basically Visual Studio has figured out that oh we want to copy something but we're too lazy to tell it what to tell me she'll steal you what it is so it takes the whole line so ctrl V will give you all of those and another common scenario if I place the cursor on this line here do ctrl C can I now get back to this line yes we can so if I do ctrl V of course I get the latest one but if I hold ctrl shift down and press V multiple times we see that there's our there's the last guy so basically wishes to you has say a clipboard ring here with like I don't know 512 items maybe something like that Tom seven so just keep shift control press down and hit V multiple times and you will cycle through that clipboard ring if I want to delete a whole line let's say I want to remove this I'll just make one cup because maybe we want one around we'll just go ctrl shift L so ctrl shift L deletes a line without placing it in the clipboard so it's a little different from control X which removes the line basically cuts the line and puts it in the clipboard so ctrl shift L just deletes a line for us something else that's kind of handy if I put the cursor on a line and I press Alt key alt pressed and use the arrow keys I can move the line anywhere I want of course it works with several lines as well okay so before we end the first part of this video I almost forgot my favorite favorite keyboard shortcut in Visual Studio which is go to all so if we press ctrl T we find ourselves in this little part of Visual Studio so go to all type whatever you want to get help so here is basically the same thing as ctrl Q only it's regarding our code instead of issue student studio features so here I can type program and hit enter to go to program we can go P for person so it's basically it indexed every member of every type in our solution we can also do stuff like we had a name over there and we can filter this out and say I just want to see my I want to see members or all I want to see types files or lines so this is super helpful so rather than jumping around in the solution Explorer and picking having to remember what where was that file located you can you know you can just go ctrl T type whatever you're looking for and that thing will help you out so person hit enter and it'll show up one last tip you can see here in the solution Explorer it's actually highlighted person here that I'm working with person and if I would go would go to program again it will highlight that one in case you're wondering what that's all about it's in tools options and projects and solutions and there's this little item here track active item in solution explorer so that's the one okie-dokie so that's it for the first part of this video now check out video number see you soon
Info
Channel: Pontus Wittenmark
Views: 26,280
Rating: undefined out of 5
Keywords: vs2017, visual studio, visual studio 2017, keyboard shortcut, keyboard shortcuts, productivity, pontus wittenmark
Id: r4OunLmSMAU
Channel Id: undefined
Length: 13min 3sec (783 seconds)
Published: Sat Aug 05 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.