0:00 - Intro 1:33 - Opening project file in the file explorer & full file path 2:56 - Extracting interfaces (auto properties) 4:08 - Suggesting usings in reference assemblies and NuGet packages 8:50 - F12 or ctrl+F12 11:23 - "Go To..." tips (ctrl+t or ctrl+,) 18:11 - Refactoring tips (ctrl+. or alt+enter) 25:11 - Document format (ctrl+K,D) 27:20 - LINQPad - C# interactive (test out your code) 31:03 - Move around code lines (alt+ arrow keys [up or down]) 33:05 - Find out method parameters (ctrl+shift+space) and bring up IntelliSense (ctrl+j) 35:55 - Change text in multiple lines at once (alignment dependent) (shift+alt +[arrow keys or mouse drag]) 39:06 - some more ctrl+. - matching filename with class name
@IAmTimCorey4 жыл бұрын
Thanks! Someone already beat you to it. I have similar timecodes in the description.
@RalfsBalodis4 жыл бұрын
@@IAmTimCorey I noticed. After... :) Still. More videos to go, as I watch them :)
@andrewjarman49994 жыл бұрын
Great video. Another useful one is clipboard history, Ctrl+Shift+V, which shows the last 10 things copied.
@IAmTimCorey4 жыл бұрын
Did you know Windows has one as well? Win+V
@jameslacey36744 жыл бұрын
@@IAmTimCorey The one for Windows needs to be turned on in settings. But, once it's turned on it can be used in VS, Word, Excel, etc.
@GrahamStw4 жыл бұрын
*Scroll Bar Map* - a navigation one I find really useful: go to _Tools-> Options...->Text Editor->All Languages->Scroll Bars_ and turn on _"Use map mode for vertical scroll bar"_ - your scroll bar is now a mini document map. Makes it really easy to know where you are in larger files and quickly scroll to the right place.
@IAmTimCorey4 жыл бұрын
Excellent, thanks for sharing!
@overb4 жыл бұрын
Hello Tim, even i am using visual studio and c# for the last ten years, following you videos, i always found tone of tricks that really i don't knew. you are a great man. thanks
@IAmTimCorey4 жыл бұрын
Great to hear!
@pierreplourde3 жыл бұрын
Numbers 1, 4, and 10 were brand new to me and #4 is worth its weight in gold!
@IAmTimCorey3 жыл бұрын
Awesome!
@vahradrimaakeroth39043 жыл бұрын
Really surprised not to see Ctrl+r+r in these 10 gems. I use it every minute of the day to rename all occurrences of a variable in a file. Cursor on a variable, Ctrl RR, type the new name, hit enter, no need to check if you forgot any of them (works in comments too)
@FractalWanderer3 жыл бұрын
Holy wow, you have no idea how much time you will have saved me
@JuanUrbaez5 жыл бұрын
Ctrl + R + R : Rename Rename a variable, property, method, or class. It's easy to remember because of the R (rename). Alt + F + F + 1: Open Recent File I would have loved an open-recent-file shortcut like VS12's ( Ctrl + Shift + Z ), which is no longer a default shortcut. I have resolved to use Alt + F + F + 1. You can replace the number 1 for any of the files in the menu File / Recent Files. i.e. Alt + F + F + 3 opens the 3rd recent file. Tim...thou art the man! Your video tutorials have saved me so much time and, more importantly, sparked curiosity in the topics you cover. Sincerely...Thank you!
@IAmTimCorey5 жыл бұрын
I am glad you enjoyed the video.
@azizanhaniff92944 жыл бұрын
Hello Tim. I just started out exploring .NET Core / C# and just wanted you to know that your guidance are truly resourceful. I want to say thanks and appreciate all the effort you've put into making all of them.
@IAmTimCorey4 жыл бұрын
Glad to help!
@MathGeekQ4 жыл бұрын
An extension to tip #10, if you hold down CTRL + ALT, you can click anywhere on any line to get the same behavior but it doesn't have to be aligned. Another one i really like is CTRL + D, which will replicate the line of code the cursor is on right below it.
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@b0570nk46 жыл бұрын
Additional shortcuts I use on daily basis: CTRL+M+O = Collapse blocks of code of all members (same as if you collapsed them manually one by one using the [ - ] and [ + ] buttons next to the line number CTRL+M+M = Collapse/Expand current block of code CTRL+R+R = same as F2 = Refactor identifier under the cursor CTRL+Up/DownArrow = Move screen one line up/down (while keeping cursor locked at the current line) CTRL+. (dot) on constructor parameter = There is option to "initialize field" - it will create a private member with that type and set it in the body of the constructor... Then you can CTRL+R+R or F2 on the member and rename it to use underscore as prefix CTRL+; (semicolon) = jump to Solution explorer (then using down arrow to navigate the listbox) (use ESC to return to the code - not needed to click with mouse) CTRL+Tab+Arrows (dont release it) = keeps "switch tab" window open and then using the arrow keys you select which tab/window to switch to CTRL+Alt+I = Immediate window - very useful while in break mode when debugging (again, ESCape for return to the code - not needed to click with mouse) CTRL+Alt+O = Output window CTRL+R+G = removes unnecessary using statements CTRL+K+S = Surrounds selected code with ..... (for example, #region, IF statement, etc.) CTRL+K+X = pop up "Insert snippet" window Snippets (write below text and press Tab twice): propf = inserts full property including field prop = inserts auto property ctor = inserts constructor for current class fore = inserts foreach construct #reg = inserts #region ---- #endregion construct
@IAmTimCorey6 жыл бұрын
Thanks for sharing.
@MiikaKontio4 жыл бұрын
Control+k+d format document
@roycelithgo39685 жыл бұрын
FYI, Format Document on VS2019 is Ctrl+K, Ctrl+D. Ctrl+E, Ctrl+D just gives a bell sound. I think this and the refactoring embedded classes to their own file are awesome tips. Thanks Tim!
@IAmTimCorey5 жыл бұрын
It depends on how you set up the shortcuts initially (I forget the exact choice that changes this). My VS2019 still is set up as Ctrl+E,D Glad you enjoyed the tips.
@KelseyThornton3 жыл бұрын
These are great tips, Thank You! (I'm never going to be able to remember all these :D !) Don't think anyone's mentioned this (and yes, I know it's an old video). @37:25 you say you can only use this feature if the locations are in alignment. While this is true for , you can also use and then mouse click on random places in your code and then anything you type is carried out at each discrete location. So, for example, if you want to change the name of a variable, you can use this to click on the start of the variable name everywhere in your code and then start typing (yes, I know this may be a bad example because you'd probably be better using find/replace, but you get what I mean.)
@tomthelestaff-iamtimcorey75973 жыл бұрын
Thanks for sharing! I have seen Tim do that before in other videos. It just must not have made the cut for this one. To help you remember all the tips, look at the video notes (Show More above). A viewer also broke the video into chapters for you so you can jump to the key spots in the video to review.
@amoswittenbergsmusings4 жыл бұрын
Tim, I love your videos! I have been coding 30++ years but I am leaning tonnes of things from you. I missed one very useful VS feature: *Ctrl-R* *Ctrl-R* for renaming everywhere, *including* *filenames* . So, instead of renaming a class and then Ctrl-. for refactoring, just do it in one go _and_ make sure all your references are correct as well. I *never* just rename in the editor and then fix the consequences. I let VS take care of everything.
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@johnarnold86035 жыл бұрын
Get tips, thanks! When doing the rectangular highlighting, with the mouse, you don't have to hold down the Shift key, just the Alt key. In addition to F12 and Ctrl + F2, I love Alt+F2. It shows the definition in a pop up window below where you are editing. Also, Ctrl + - is great to use to go back to the previous place(s) you were editing. Ctrl + Shift + - does the reverse (after you have hit Ctrl + -)
@IAmTimCorey5 жыл бұрын
I am glad you enjoyed the video.
@mehr525 жыл бұрын
Thanks Tim, number 6 in VS 2019 is Ctrl+K, Ctrl+D
@IAmTimCorey5 жыл бұрын
It depends. It isn't on my default installation. Different setups can have different shortcuts (which is frustrating).
@tehseensajjad10033 жыл бұрын
CTRL + R, R is one of the best. Renames all instances of an identifier.
@IAmTimCorey3 жыл бұрын
Yep, that's a good one.
@codeceps6 жыл бұрын
Gosh that goto shortcut is pure gold.
@IAmTimCorey6 жыл бұрын
I love it. I figured others would too.
@DK-tr7ir6 жыл бұрын
Tim, I love you for #9 :D It is so often I have to check the signature of a method or to change the method invoked on an object and I have never thought there are shortcuts for this. incredible) I believe everyone has borrowed something from this video Let me share some hotkeys I use frequently alt+F12 gives you a popup with the code instead of taking you to the file with that code ctrl+G search by line instead of ctrl+, prefix : (actually useful when examiningc code from an exception stack trace) ctrl+- takes you to the position of last edit (my personal favourite) ctrl+x cuts entire line (i use it a hundred times a day) ctrl+K,S surrond with (#region, #if, if, for etc.) ctrl+M,M; ctrl+M,L; ctrl+M,O; ctrl+M,P opens/collapses sections of code and here goes wow :) ctrl+TAB switch between opened files - I discovered this just now, while watching this video and playing around with hotkeys:D gonna use it heavily another useful thing - split current window in half by dragging down by an icon at the top of the scroll (just above the up arrow)
@IAmTimCorey6 жыл бұрын
Very cool. The only problem I have is that you need to memorize so many shortcuts and a lot of them are multi-key shortcuts (more than two). I forget what I don't use all the time.
@dancilman90364 жыл бұрын
So many great tips in here - The C# Interactive window and Shift-Alt to block select are my favorites. Thank you for these videos!
@IAmTimCorey4 жыл бұрын
Glad you like them!
@alexcurtisdev6 жыл бұрын
Fantastic video, always appreciate the way you provide multiple examples when teaching. I knew only half of these shortcuts, lots of which I use daily. Picked up CTRL+E+D from a Senior Developer at work, always useful having other team members code with you. Each have their own little tricks/methods of doing things. From the video, CTRL + J and CTRL + Shift + Space will be for me the most useful. Everyday, the IntelliSense appears momentarily then disappears so I retype the last few characters to re-prompt IntelliSense. Knowing this is great! I liked the CTRL + T functionality, nice intuitive/advanced search. I found the CTRL + . functionality interesting, I knew of it and use it frequently, however I didn't know it could be used to do some of the refactoring in the video, such as getting rid of unused namespaces, and moving a class to it's own file. Before I would have created a new class and copied it across, like you outlined. The interactive C# window is a nice feature, didn't know of it, usually use LINQ Pad however, may find myself using this now, in certain situations. Thanks for making these videos, always appreciated!
@IAmTimCorey6 жыл бұрын
I'm glad you were able to gain some new productivity boosters.
@janoslaszlo32724 жыл бұрын
Ctrl+J was new for me. I'm going to use it from now on.
@IAmTimCorey4 жыл бұрын
Great!
@cleversonsutil44954 жыл бұрын
Very useful!! I discovered this feature on Notepad++ and since then, if an editor doesn't have it, I found it kind of lacking.
@stan1k6194 жыл бұрын
Same here, really useful feature!
@L3712 жыл бұрын
Where was this info years ago? Well, right here of course, but I'm just learning now. Shift-Space to bring up method parameters... I had no idea. Ctrl-J to show other methods in the class? Wow. Even simple Alt-Arrows to move one or more lines up and down. Tim, your videos are invaluable for developers of all skill levels, whether simple tips and tricks or complex concepts broken down into simple parts. Thanks for all you do!
@williamrood89336 жыл бұрын
Great video! I didn't know of about half of these and I'll definitely be using the search options more. RE tip 10, you can now have multiple cursors even if they aren't aligned. Hold CTRL+ALT and click anywhere in your document to place a cursor. I use this a lot. You might need to update VS to the latest version though. Oh, and that interactive console is sweet. I had no idea that was there!
@IAmTimCorey6 жыл бұрын
Yeah, I think they released that in 15.8, which came out about three days after I recorded this video. Oh well. Thanks for pointing it out though.
@alemicuta8star4 жыл бұрын
37:37 - you can do that with CTRL+ALT and Highlight/Select the text Thank you, your videos are SO helpful! :)
@IAmTimCorey4 жыл бұрын
Thanks for the tip!
@rolstonholas3334 жыл бұрын
I did some work on VBA, never used it before, but a helpful person on YT pointed me to the Immediate window which I used extensively. So my favourites are the C~ Interactive window and the Shift+ALT, they are going to come in very handy. Thanks Tim :)
@IAmTimCorey4 жыл бұрын
You are welcome.
4 жыл бұрын
Awesome video as usual! Some I knew some I didn't and, to be honest, I have forgotten about some of these amazing features. Looking forward to watching many more videos.
@IAmTimCorey4 жыл бұрын
Glad you enjoyed it!
@EricHarmon675 жыл бұрын
Great video. I've been using Visual Studio since about the early 1800s, yet I learned several things here that I either didn't know about, or had completely forgotten about. I think it's interesting that Ctrl+K/Ctrl+D and Ctrl+E/Ctrl+D do the same thing.
@IAmTimCorey5 жыл бұрын
Excellent!
@desousamateus1145 жыл бұрын
youre pretty old, bru
@EriAirlangga5 жыл бұрын
The most satisfying ones are: Ctrl+K,C and Ctrl+K,U for commenting and uncommenting big lines of code! Write down each one of these then followed by TAB, TAB (these definitely save you big time!): ctor, prop, propg, propfull, for, foreach, try, tryf Ctrl+K,X to access all those code snippetsAlt+B+U (Build Project), Alr+B+B (Build solution) MS has been extremely consistent on keyboard shortcuts since decades!
@IAmTimCorey5 жыл бұрын
Those are nice. I just wish the ones I want weren't behind two keys. I could re-map them but then I'd have to let everyone know that I did. I still might do it for some things.
@bobpond63813 жыл бұрын
As always awesome content. Column mode copy paste is an adventure as well and all column mode is hugely useful. I write vary complex systems and employ the same logic which requires the same code so column based edit or copy paste saves a lot of time. Thanks Tim for your effort and content.
@robe58236 жыл бұрын
This is an awesome video Tim, thank you for sharing this knowledge and I hope this one blows up for you
@IAmTimCorey6 жыл бұрын
You are welcome.
@harag96 жыл бұрын
Love these top x videos as there is always one you don't know. In this case for me it was #7, Interactive Window. However the Show Intellisense is a a close 2nd because I always forget the shortcut keys for it :) #6 - Formatting code, I would highly recommend the "Productivity Power Tools" extension - it has a "Format document on save" option and remove/sort usings on save. Great little tool, plus other useful features! Great video Tim, thanks for doing this!
@IAmTimCorey6 жыл бұрын
Thanks for the suggestion. I'm glad you got something out of this video.
@Old.Man.Of.The.Mountain5 жыл бұрын
My goodness Microsoft, you have done some wonderful things here with the VS IDE. But when you have been using the VS IDE for more than two decades to write millions of code to build/refactor/retire dozens of product lines -- like Microsoft's Engineers have clearly done -- any code editing conveniences sought are inevitably going to make their way into that IDE. And we, outside of Microsoft, benefit from it. And thanks to Tim for pointing these options and conveniences out.
@IAmTimCorey5 жыл бұрын
You are most welcome. Thanks for watching.
@romeoromano30505 жыл бұрын
agree!!!
@peteredenburg64646 жыл бұрын
I hope this little trick I found helps people out. It definitely stems from my focus on my preferred usage of the keyboard over the mouse ... everywhere ... not just in Visual Studio. If your cursor is somewhere either within a statement or touching the very beginning or end, your can hold down the Control key and press w a couple of times and the selection expands with each pressing of the w key. Recently while taking Tim's SQLite Start to Finish course, I noticed that for reasons unbeknownsed to me (I certainly did not type them, nor where they in Tim's recording of the video) in the xaml coding for the forms there were column span statements. Since they weren't part of the code I wanted those out of there. Easy, place the cursor either in or at the begin/end, hold Ctrl and three quick presses on the w key, press delete and its done. I do hope its w as well for people with other regional settings on their system than mine. Formatting the document using Ctrl + E, D for example which was a familiar feature of VS to me, but with Dutch regional settings I need to use Ctrl + K, D
@IAmTimCorey6 жыл бұрын
Yep, that's a good one.
@peteredenburg64646 жыл бұрын
I'm glad contribute the other way around for a change.
@aleksandaril4 жыл бұрын
Ctrl J is indeed helpful. I knew most of the others, as I work with shortcuts a lot, but still great video. [C# Interactive] is also awesome. I was using [Immediate Window] until now, but there is no IntelliSense there. So thank you for that one as well. Few suggestions from me (small tips) about 1) How to scroll up/down without a mouse: Click somewhere in the code, and then Ctrl Up/Down arrow. It scrolls the screen without moving your cursor's position. 2) Cut a line of code without selecting and without the mouse at all: Put your cursor on the line you want to cut and Shift + Del. Entire line is gone (but is available in the clipboard for pasting). So Ctrl+V pasts that line where ever you want. Probably most of the developers already know these, but I still hope someone would find them helpful. Thank you.
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@RobinHood706 жыл бұрын
Another quick point on the Go To Implementation feature: if you're using it in a situation where there are multiple valid choices (e.g., some interfaces and abstract classes), VS will open a window in the same place as the Output, Warnings, etc. windows that lets you choose which implementation to go to.
@IAmTimCorey6 жыл бұрын
Yep, thanks for pointing that out.
@abdelaliboussetta14504 жыл бұрын
Just landed into this channel. first impression : Awesome !
@IAmTimCorey4 жыл бұрын
Welcome! I'm glad you are enjoying the content.
@ahmetbibi4 жыл бұрын
One is from me :) when you select a word, you can find all the occurrences in that document with ALT + Shift + . combination. When you hold ALT + Shift then by pressing. you can select all of them. It's also useful sometimes.
@IAmTimCorey4 жыл бұрын
Thanks for sharing the tip!
@vladimirkozel63974 жыл бұрын
Tim, thanks, great. I did not know C# interactive, CTRL+. and CTRL+T. Thanks.
@IAmTimCorey4 жыл бұрын
You are welcome.
@AnalogGame4 жыл бұрын
Super useful Gems!! Great video as always!
@AnalogGame4 жыл бұрын
No.10 - Multi-Cursor (Shift+Alt+Up/Down Arrow) , 1) Just press and hold Alt + click and drag will also do the tick
@IAmTimCorey4 жыл бұрын
Thanks for the Tip.
@davidbrook95374 жыл бұрын
Alt-Space seems to open the Command Line. Alt-MouseClick works like Shift-Alt where you can select multiple groups of data. When you use Shift . you can use tab to scroll through and enter to select. Great stuff.. Thank you! David
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@thoutamdurgaprasad29664 жыл бұрын
This is super cool and very helpful. I hardly know 5 of them and rest 5 are new for me. Especially C# interactive💚. Thank you Tim.
@IAmTimCorey4 жыл бұрын
Glad it was helpful!
@99MrX996 жыл бұрын
Very useful tips thanks, but you missed one very important to me: The F2 key. It practically does the same as your bonus tip with renaming but not afterwards. You just put your cursor on a variable/method/class ... and hit F2 and you can instantly rename it and you get live preview where it will be changed and after hitting enter it will apply.
@IAmTimCorey6 жыл бұрын
Thanks for pointing it out. I don't use F2 because I always found it quirky but it is definitely a hidden gem.
@Unordinal4 жыл бұрын
Didn't know 1, 4, 6, 7, 8, and the Ctrl + J part of 9. Gotta say, I do manually what Ctrl + J does automatically so often, as well as the ability to move lines with Alt + Arrows. These are gonna be extremely helpful to know! Thanks for the videos as always!
@IAmTimCorey4 жыл бұрын
Awesome!
@neoanderson79625 жыл бұрын
Thanks again for the video Tim. My Resharper trial just expired and I was considering subscribing. However, after watching this video I realized there are several cool features right in Visual Studio that would most likely serve my needs satisfactorily. My favourite by far is the interactive window !!!!
@IAmTimCorey5 жыл бұрын
Excellent! I am glad you are checking out the great features built into Visual Studio. The Visual Studio team has been working hard to provide an amazing product.
@joemieszczur97356 жыл бұрын
completely forgot about the damn options in VS. you have easily increased my productivity three-fold. a few i use daily, like the alt+arrows. document formatting, also my favorite command combo is "Ctrl+M, +O" which collapses document. and now that i know about options again, lol, there's even a box to make regions collapsible with the same command.
@IAmTimCorey6 жыл бұрын
I'm glad I was able to help you become a lot more efficient in your development.
@Paolen3 жыл бұрын
I know this is old video but for the last gem you can just hold alt and hold click while moving the mouse to box select from your mouse cursor. This also works with other editing software like notepad++. Thanks for the info.
@tomthelestaff-iamtimcorey75973 жыл бұрын
Thanks for the Tip!
@muhammadzeshawn38836 жыл бұрын
Nice work.. Great video.. I appreciate your work and effort tim, Please keep up the good work..
@IAmTimCorey6 жыл бұрын
Thank you.
@onyebuchiboss6 жыл бұрын
I did not now about c# intereactive dialog, currently using it at work now. thanks Tim.
@IAmTimCorey6 жыл бұрын
Awesome!
@MrLuckyalmond4 жыл бұрын
This is so good. Thank you.
@IAmTimCorey4 жыл бұрын
You are welcome.
@shashikantchitalkar47884 жыл бұрын
Thanks Sir..I knew one additional which is ctrl +k k which will bookmark line number and user can able to find all bookmarks with ctrl+k , ctrl +w which helps lot
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@rem-od5wz4 жыл бұрын
I learned dotnet core 3 with your video in 40 minutes. Thanks alot.
@IAmTimCorey4 жыл бұрын
Great to hear!
@gakshay95375 жыл бұрын
Thank you Tim. These cool features should definitely reduce my time going forward. The one which I can use the most would be C# interactive and Shift+Alt+up/down arrow
@IAmTimCorey5 жыл бұрын
I am glad you found them helpful.
@surendrarajpoot14 жыл бұрын
Awesome options to know, Thank you very much for mining these gems for us.
@IAmTimCorey4 жыл бұрын
You are most welcome. Thanks for watching.
@surendrarajpoot14 жыл бұрын
@@IAmTimCorey Could you please make something about design patterns like Singleton, Factory etc.
@IAmTimCorey4 жыл бұрын
It is on the suggestion list. Thanks!
@matiascatanzariti11955 жыл бұрын
Ctrl + . is really great and powerful. The column selection tip (last one) can also be used just with alt, and can be enhanced by using cut/copy and paste. For example, if you have a in text editor (like Notepad++ that also allows column selection) a list of strings to put in the Console.WriteLine argument, you can copy and paste inside the double quotes and it will fill all the lines, even if your strings have different lengths.
@IAmTimCorey5 жыл бұрын
Thanks for the tip.
@LuigiZambetti6 жыл бұрын
Another useful video. Thank you so much Tim.
@IAmTimCorey6 жыл бұрын
You are welcome.
@karendoran36926 жыл бұрын
Tim...awesome video as always!!! Would you consider doing a video on creating your own custom controls/forms that you can save as templates for future projects?
@IAmTimCorey6 жыл бұрын
Custom controls are coming in the future at some point.
@JustinMinnaar6 жыл бұрын
Try installing CodeMaid extension. Then set is options to auto format and clean your code on save. Use it for years and consider it invaluable and the best extension.
@IAmTimCorey6 жыл бұрын
Thanks for the recommendation. I typically don't use extensions as much as possible since I don't want the extensions to be a distraction for my videos. However, I'm putting together a list of helpful extensions and this will probably make the list. Thanks again.
@techdave996 жыл бұрын
another useful tip is that you can quickly type method names by just typing the uppercase characters in the name. So, type Console.WL for Console.WriteLine. Handy for the names that are a million characters long. (of course you can get the wrong name selected but it is easy to pick from the list that pops up.)
@IAmTimCorey6 жыл бұрын
Yep, that's a good one too. I use that one a lot, although for Console.WriteLine, you can use the "cw" snippet (type cw and tab twice).
@niyaz86 жыл бұрын
I didn't know about CTRL + J. Thanks Tim! I think I'm going to use it a lot :)
@IAmTimCorey6 жыл бұрын
Excellent!
@RobinHood706 жыл бұрын
Things I didn't know about: Ctrl-T, Alt-Up/Down, Rectangle Highlighting (though I kinda thought VS had it somewhere, just didn't know how easy it was). Ctrl-Click on method/whatever is another biggie for me. That'll be a big time-saver. I always used to just use right-click Go To Definition. I knew F12 was there, I just didn't really use it. Ctrl-Click will be much faster than either! Two things that come to mind that I use which you didn't highlight here: Rename Class and File together: instead of renaming the class in your code, then renaming it via Ctrl-., just rename it in the Solution Explorer. As long as the names started off matching, Solution Explorer will prompt you if you want to rename both the class and the file. Say Yes, and it'll rename both. If they don't match, though, then Ctrl-. is the faster way to go. Snippets: these are probably a whole presentation on their own (which I'd love to see, if you don't already have one that I missed). When I first started in C#, I dismissed snippets as fairly useless for someone who types reasonably fast. After all, what's the point of pressing a bunch of keys to get a simple if/else block, then having to cursor back up and fill them all in when autocomplete and plain old typing will do it a lot faster and in the proper order. But a lot of snippets are more interactive, like the switch snippet which offers the option to fill in every possible option if you're switching on an enumeration variable. I'm still discovering what snippets are actually useful, but they're definitely not something that should be dismissed as quickly as I originally did.
@IAmTimCorey6 жыл бұрын
Snippets are really awesome. I use them all the time and try to point them out (if, try, prop, propfull, etc.) I'll definitely be doing a video on them in the future. It will include how to create your own snippets.
@HieuNguyen-kt9ks4 жыл бұрын
Hi Tim, Number 7 and 9 are new to me. Thank a lot!
@IAmTimCorey4 жыл бұрын
Great!
@HectaSpyrit4 жыл бұрын
Didn't know about Ctrl+,/Ctrl+T, format document, and Ctrl+J (probably my favourite of all ten, that and format document) and Ctrl+Shift+Space! Those are gonna come in handy for sure
@IAmTimCorey4 жыл бұрын
Excellent!
@yakovvorontsov625 жыл бұрын
You didn't mention ctrl + D, which allows you to copy the line of code without using the clipboard.
@IAmTimCorey5 жыл бұрын
I don't use it that much. Thanks for sharing though.
@MiskoKatua3 жыл бұрын
didn't know that one. I knew Ctrl+L which cuts the whole line.
@INBarfa6 жыл бұрын
Awesome video as always, #6 on mine is Ctrl+k, Ctrl+d.
@IAmTimCorey6 жыл бұрын
Yep, there are apparently different shortcut schemes that you can implement.
@RawbLV4 жыл бұрын
You can close tabs with the middle mouse button :)
@IAmTimCorey4 жыл бұрын
Thanks, but my middle mouse button is my scroll wheel. When I try, I scroll as well, which then causes other issues.
@madbats694 жыл бұрын
Love using the middle button to close tabs. Very useful!
@parvejsolkar1234 жыл бұрын
Ctrl j was new to me, thanks 🙂 Addition from me, 3 drop-downs at top in any file for assembly, class, functions/member properties... Super handy and they are sorted alphabetically
@IAmTimCorey4 жыл бұрын
Glad it helped!
@danishmalak92212 жыл бұрын
Ctrl + F12 🔥. Thank you.
@IAmTimCorey2 жыл бұрын
You're welcome!
@rahuldewada20093 жыл бұрын
Hey Tim, For the code formatting we can also use Ctrl + K and Ctrl + D. Appreciate the great video.
@IAmTimCorey3 жыл бұрын
You are welcome.
@Ethaniel672 жыл бұрын
Old comment but I think Ctrl+K Ctrl+D is for those of us who keep upgrading visual studio, because The E version doesn't work for me but I use KD all the time
@bvandevliet2 жыл бұрын
Very nice, didn't know about the Go To search. I think one thing you've missed is the very powerful rename feature (F2). It's what I thought near the end of the video when you renamed a class name. I believe it even renames the filename as well when renaming a class. Using F2 it will also rename all references to it. But nonetheless awesome video, very useful, thanks!
@IAmTimCorey2 жыл бұрын
That is a nice feature as well.
@danylaws6 жыл бұрын
Great tips ! The Alt + Up or Down To move a bloc of code is awesome. The interactive C# can also be welpful. But they are all great anyway ! Thanks Tim ! :-)
@IAmTimCorey6 жыл бұрын
You are welcome.
@dand44855 жыл бұрын
One more gem i really like. Sometime when debuggering as our objects get populated there might be some specific properties that we are more interested in, say the class's key values or say a count or a datetime value. Let's call these the main values of interest for a given class/object the we want to know say 90% of the time of what makes the object meaningful... You may decorate your classes with an attribute to tell Visual Studio what you want to see in the debug watch window. Enough talking... :) [DebuggerDisplay( "{Property1} {Value2} {Description}" )] public class MyClassToShowCustomerDebugInfo { string Property1 { get ; set } int Value2 { get ; set;} public MyClass foo { get; set;} string Description { get; set; } /* More goo... */ } main() { MyClassToShowCustomerDebugInfo checkThisOut = new ...; } So let's add the variable "checkThisOut" to the debug window. Now look at the the variable in the debug watch window., should now see the value for thte instance variable as you specified in the interpolated string you define, Also is did puput in a string label, but you can do that too so "Value2 = {Value2} Desc = {Description"}" the value will be shown as you would expect. Easy and simple and so helpful for the most common cases, should see that you may still drill into the object just as you normally would... Enjoy :)
@IAmTimCorey5 жыл бұрын
Nice! Thanks for sharing.
@decisivepro19615 жыл бұрын
The last tip is very useful, thanks!
@IAmTimCorey5 жыл бұрын
You are most welcome. Thanks for watching.
@dand44855 жыл бұрын
My favorite gem not touched, in the article is code snippets. The one i really like if switch. When you start a switch for an enum get just: switch Now press "TAB" (might need to press "ESC" to get rid fo the intellisennse window. But once the code snippet is invoked you enter either an enum or a variable that is an enum type then press enter, should get a case for each value in the enum... Simple example: public enum Foo { One = 1, Two = 2, Default = 0 } public void Test() { switch(Foo) { case Foo.One: break; case Foo.Two: break; case Foo.Default: break; default: break; } }
@IAmTimCorey5 жыл бұрын
That is really nice.
@leifbogeisler2 жыл бұрын
For goto to line I use CTRL+G and for format document I use CTRL+K+D, but a lot of other stuff, I did not know
@IAmTimCorey2 жыл бұрын
I am glad it was so helpful.
@RomanOgorodnyk4 жыл бұрын
Hi Tim, number 9 is new to me. Thanks about that
@IAmTimCorey4 жыл бұрын
Glad to help!
@MrMimzoo4 жыл бұрын
c# interactive window is really nice and I didn't know !
@IAmTimCorey4 жыл бұрын
I'm glad you learned about it.
@Sonny02766 жыл бұрын
Great Video. Thank you for posting.
@IAmTimCorey6 жыл бұрын
You are welcome.
@doraechizen846 жыл бұрын
Now i know there are lots of hidden feature in vs...thank a lots tim corey
@IAmTimCorey6 жыл бұрын
You are welcome.
@KaushikGanguly724 жыл бұрын
CTRL + . is the most used one. But there is one more useful option that is "Show Clipboard HIstory" which allows you to paste something which you have copied earlier.
@IAmTimCorey4 жыл бұрын
Do you mean CTRL + Shift + V?
@Chiramisudo4 жыл бұрын
I didn't know: 1, 2, 8, 9 I use all the time: 3, 5, 6, 10 Favorite new tip: *8* (hands down freaking awesome!)
@IAmTimCorey4 жыл бұрын
Excellent! I'm glad it was helpful.
@texaslinux4 жыл бұрын
I can't believe I didn't know ctrl+T, that is amazing!
@IAmTimCorey4 жыл бұрын
I am glad you learned something new.
@fayax4 жыл бұрын
Excellent... I think you just doubled my coding speed.
@IAmTimCorey4 жыл бұрын
Glad I could help!
@SrinubabuRavilla4 жыл бұрын
Amazing tips.... Thanks Tim
@IAmTimCorey4 жыл бұрын
You are welcome.
@MrPrezDev4 жыл бұрын
*TIP:* You can hold *CTRL+ALT and click* anywhere in the code to place additional cursors in VS2019 at least.
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@MrPrezDev4 жыл бұрын
@@IAmTimCorey My pleasure and thank you for your awesome videos, they are highly appreciated.
@MiskoKatua3 жыл бұрын
Great one!
@kitsurubami4 жыл бұрын
i was surprised to find out that i actually know a few of these :D
@IAmTimCorey4 жыл бұрын
Awesome!
@ashishsah69674 жыл бұрын
Enjoyed this. Will implement it in future. 1) Is there any shortcut or better ways to deal with references/assemblies? Sometimes we need to update the references (sql or 3rd party) in our projects and we have change it manually in each one. Is there any easier way ? 2) Could you please also do a session on best practices while using GIT ? Thank you.
@IAmTimCorey4 жыл бұрын
NuGet is the solution for updating references. It makes it easier to do. As for git best practices, I can add that suggestion to the list.
@Jurazgar1 Жыл бұрын
For newcomers to this video the Ctrl + E + D trick in Vusual Studio 2022 is Ctrl + K + D. It changed for some reason.
@IAmTimCorey Жыл бұрын
I think it is a matter of which set of shortcuts you use. I believe in this video, my shortcuts had been upgraded from old enough versions of Visual Studio that they were different than the new defaults. I've sinced fixed that.
@darklen144 жыл бұрын
its CTRL +K+D now for format
@IAmTimCorey4 жыл бұрын
Thanks for the tip
@MiskoKatua3 жыл бұрын
Ctrl E+D still works
@amrutkalamkar62174 жыл бұрын
Thanks for Very helpful tricks. Didn't knew Ctrl+T
@IAmTimCorey4 жыл бұрын
You are welcome.
@yukselaydemir2 жыл бұрын
In VS 2022 the "Format document on save" option is now available. Instead of using shortcuts you can format the document by saving it.
@IAmTimCorey2 жыл бұрын
That is a nice addition, for sure.
@miltoszoumekas7567 Жыл бұрын
Where is this setting?
@MiskoKatua3 жыл бұрын
I even adjusted the Class Template (for VS2019: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs") to get rid of all those unused usings and put public in front of class instead of re-typing it every time I make a new class
@IAmTimCorey3 жыл бұрын
Great. You can also create your own item templates if you don't want to mess with the built-in ones: kzbin.info/www/bejne/aaa8f2ajeauDY9E
@jgcornell5 жыл бұрын
For some reason, my my reformat document is Ctrl+K Ctrl+D, I have no memory of remapping it, but I've been using it for ages, and Ctrl+E Ctrl+D does nothing. Odd.
@IAmTimCorey5 жыл бұрын
Yeah, I haven't figured out the reason but it seems like half use ED, half use KD.
@KishorTiwari4 жыл бұрын
Same here
@itsolutionsdev4 жыл бұрын
CTRL+R R to rename variables and classes and all its references - very usefull
@IAmTimCorey4 жыл бұрын
I'm glad.
@MohammedDerbashi4 жыл бұрын
Hi Tim, some shortcuts are not the same as you have showed, for example for Formatting document I have to use Ctrl+K, Ctrl+D !! I'm using VS2019 16.5.4 , any clue?
@IAmTimCorey4 жыл бұрын
In VS, you can set up profiles for VS that change the shortcuts. They have a couple in by default. My settings were old enough that they carried over from a previous version, and those are no longer the defaults. Since then I have switched back to the defaults to make it easier to match what the majority of people have.
@MsSharayu4 жыл бұрын
Ctrl+E, D is changed to Ctrl+K,D in VS 2019.
@IAmTimCorey4 жыл бұрын
Thanks for the tip
@MiskoKatua3 жыл бұрын
Ctrl+E, D still available in 2019 (K,D also works)
@petrutarabuta56173 жыл бұрын
The "Format Document" shortcut has changed to Ctrl+K, Ctrl+D in VS 2019 (16.9.4). It's still under the "Edit >> Advanced" menu though.
@crazedprogrammer58256 жыл бұрын
dang, i learned alot from this, why can't my guy get more likes here?
@IAmTimCorey6 жыл бұрын
I'm glad you got a lot out of this.
@GuildOfCalamity3 жыл бұрын
Is there a way to exclude commented code during a search?
@santhoshn37664 жыл бұрын
Open .cs file Use Ctrl + G -> Enter the number it will take to the particular line number.
@IAmTimCorey4 жыл бұрын
Thanks for sharing.
@doubledennis6 жыл бұрын
Great video first of all! You've showed a very nice way to clean up the using statements but is there also a quick way to clean the References inside your project?
@IAmTimCorey6 жыл бұрын
Not that I know of.
@karabasbarabas20004 жыл бұрын
One more tip - you can drag a oiece of code to the ToolBox window, and after paste it back somewhere