Top 10 Hidden Gems in Visual Studio - Speed Up Development Without Increasing Your Costs

  Рет қаралды 107,875

IAmTimCorey

IAmTimCorey

Күн бұрын

Пікірлер: 391
@RalfsBalodis
@RalfsBalodis 4 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks! Someone already beat you to it. I have similar timecodes in the description.
@RalfsBalodis
@RalfsBalodis 4 жыл бұрын
@@IAmTimCorey I noticed. After... :) Still. More videos to go, as I watch them :)
@andrewjarman4999
@andrewjarman4999 4 жыл бұрын
Great video. Another useful one is clipboard history, Ctrl+Shift+V, which shows the last 10 things copied.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Did you know Windows has one as well? Win+V
@jameslacey3674
@jameslacey3674 4 жыл бұрын
@@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.
@GrahamStw
@GrahamStw 4 жыл бұрын
*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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Excellent, thanks for sharing!
@overb
@overb 4 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great to hear!
@pierreplourde
@pierreplourde 3 жыл бұрын
Numbers 1, 4, and 10 were brand new to me and #4 is worth its weight in gold!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Awesome!
@vahradrimaakeroth3904
@vahradrimaakeroth3904 3 жыл бұрын
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)
@FractalWanderer
@FractalWanderer 3 жыл бұрын
Holy wow, you have no idea how much time you will have saved me
@JuanUrbaez
@JuanUrbaez 5 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I am glad you enjoyed the video.
@azizanhaniff9294
@azizanhaniff9294 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad to help!
@MathGeekQ
@MathGeekQ 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@b0570nk4
@b0570nk4 6 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks for sharing.
@MiikaKontio
@MiikaKontio 4 жыл бұрын
Control+k+d format document
@roycelithgo3968
@roycelithgo3968 5 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
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.
@KelseyThornton
@KelseyThornton 3 жыл бұрын
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-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
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.
@amoswittenbergsmusings
@amoswittenbergsmusings 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@johnarnold8603
@johnarnold8603 5 жыл бұрын
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 + -)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I am glad you enjoyed the video.
@mehr52
@mehr52 5 жыл бұрын
Thanks Tim, number 6 in VS 2019 is Ctrl+K, Ctrl+D
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
It depends. It isn't on my default installation. Different setups can have different shortcuts (which is frustrating).
@tehseensajjad1003
@tehseensajjad1003 3 жыл бұрын
CTRL + R, R is one of the best. Renames all instances of an identifier.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Yep, that's a good one.
@codeceps
@codeceps 6 жыл бұрын
Gosh that goto shortcut is pure gold.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I love it. I figured others would too.
@DK-tr7ir
@DK-tr7ir 6 жыл бұрын
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)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
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.
@dancilman9036
@dancilman9036 4 жыл бұрын
So many great tips in here - The C# Interactive window and Shift-Alt to block select are my favorites. Thank you for these videos!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad you like them!
@alexcurtisdev
@alexcurtisdev 6 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm glad you were able to gain some new productivity boosters.
@janoslaszlo3272
@janoslaszlo3272 4 жыл бұрын
Ctrl+J was new for me. I'm going to use it from now on.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great!
@cleversonsutil4495
@cleversonsutil4495 4 жыл бұрын
Very useful!! I discovered this feature on Notepad++ and since then, if an editor doesn't have it, I found it kind of lacking.
@stan1k619
@stan1k619 4 жыл бұрын
Same here, really useful feature!
@L371
@L371 2 жыл бұрын
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!
@williamrood8933
@williamrood8933 6 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
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.
@alemicuta8star
@alemicuta8star 4 жыл бұрын
37:37 - you can do that with CTRL+ALT and Highlight/Select the text Thank you, your videos are SO helpful! :)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for the tip!
@rolstonholas333
@rolstonholas333 4 жыл бұрын
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 :)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad you enjoyed it!
@EricHarmon67
@EricHarmon67 5 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Excellent!
@desousamateus114
@desousamateus114 5 жыл бұрын
youre pretty old, bru
@EriAirlangga
@EriAirlangga 5 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
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.
@bobpond6381
@bobpond6381 3 жыл бұрын
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.
@robe5823
@robe5823 6 жыл бұрын
This is an awesome video Tim, thank you for sharing this knowledge and I hope this one blows up for you
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@harag9
@harag9 6 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks for the suggestion. I'm glad you got something out of this video.
@Old.Man.Of.The.Mountain
@Old.Man.Of.The.Mountain 5 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome. Thanks for watching.
@romeoromano3050
@romeoromano3050 5 жыл бұрын
agree!!!
@peteredenburg6464
@peteredenburg6464 6 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Yep, that's a good one.
@peteredenburg6464
@peteredenburg6464 6 жыл бұрын
I'm glad contribute the other way around for a change.
@aleksandaril
@aleksandaril 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@RobinHood70
@RobinHood70 6 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Yep, thanks for pointing that out.
@abdelaliboussetta1450
@abdelaliboussetta1450 4 жыл бұрын
Just landed into this channel. first impression : Awesome !
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Welcome! I'm glad you are enjoying the content.
@ahmetbibi
@ahmetbibi 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing the tip!
@vladimirkozel6397
@vladimirkozel6397 4 жыл бұрын
Tim, thanks, great. I did not know C# interactive, CTRL+. and CTRL+T. Thanks.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@AnalogGame
@AnalogGame 4 жыл бұрын
Super useful Gems!! Great video as always!
@AnalogGame
@AnalogGame 4 жыл бұрын
No.10 - Multi-Cursor (Shift+Alt+Up/Down Arrow) , 1) Just press and hold Alt + click and drag will also do the tick
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for the Tip.
@davidbrook9537
@davidbrook9537 4 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@thoutamdurgaprasad2966
@thoutamdurgaprasad2966 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad it was helpful!
@99MrX99
@99MrX99 6 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks for pointing it out. I don't use F2 because I always found it quirky but it is definitely a hidden gem.
@Unordinal
@Unordinal 4 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Awesome!
@neoanderson7962
@neoanderson7962 5 жыл бұрын
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 !!!!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
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.
@joemieszczur9735
@joemieszczur9735 6 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm glad I was able to help you become a lot more efficient in your development.
@Paolen
@Paolen 3 жыл бұрын
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-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for the Tip!
@muhammadzeshawn3883
@muhammadzeshawn3883 6 жыл бұрын
Nice work.. Great video.. I appreciate your work and effort tim, Please keep up the good work..
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thank you.
@onyebuchiboss
@onyebuchiboss 6 жыл бұрын
I did not now about c# intereactive dialog, currently using it at work now. thanks Tim.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Awesome!
@MrLuckyalmond
@MrLuckyalmond 4 жыл бұрын
This is so good. Thank you.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@shashikantchitalkar4788
@shashikantchitalkar4788 4 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@rem-od5wz
@rem-od5wz 4 жыл бұрын
I learned dotnet core 3 with your video in 40 minutes. Thanks alot.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great to hear!
@gakshay9537
@gakshay9537 5 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I am glad you found them helpful.
@surendrarajpoot1
@surendrarajpoot1 4 жыл бұрын
Awesome options to know, Thank you very much for mining these gems for us.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@surendrarajpoot1
@surendrarajpoot1 4 жыл бұрын
@@IAmTimCorey Could you please make something about design patterns like Singleton, Factory etc.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
It is on the suggestion list. Thanks!
@matiascatanzariti1195
@matiascatanzariti1195 5 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thanks for the tip.
@LuigiZambetti
@LuigiZambetti 6 жыл бұрын
Another useful video. Thank you so much Tim.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@karendoran3692
@karendoran3692 6 жыл бұрын
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?
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Custom controls are coming in the future at some point.
@JustinMinnaar
@JustinMinnaar 6 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
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.
@techdave99
@techdave99 6 жыл бұрын
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.)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
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).
@niyaz8
@niyaz8 6 жыл бұрын
I didn't know about CTRL + J. Thanks Tim! I think I'm going to use it a lot :)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Excellent!
@RobinHood70
@RobinHood70 6 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
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-kt9ks
@HieuNguyen-kt9ks 4 жыл бұрын
Hi Tim, Number 7 and 9 are new to me. Thank a lot!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great!
@HectaSpyrit
@HectaSpyrit 4 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Excellent!
@yakovvorontsov62
@yakovvorontsov62 5 жыл бұрын
You didn't mention ctrl + D, which allows you to copy the line of code without using the clipboard.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I don't use it that much. Thanks for sharing though.
@MiskoKatua
@MiskoKatua 3 жыл бұрын
didn't know that one. I knew Ctrl+L which cuts the whole line.
@INBarfa
@INBarfa 6 жыл бұрын
Awesome video as always, #6 on mine is Ctrl+k, Ctrl+d.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Yep, there are apparently different shortcut schemes that you can implement.
@RawbLV
@RawbLV 4 жыл бұрын
You can close tabs with the middle mouse button :)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks, but my middle mouse button is my scroll wheel. When I try, I scroll as well, which then causes other issues.
@madbats69
@madbats69 4 жыл бұрын
Love using the middle button to close tabs. Very useful!
@parvejsolkar123
@parvejsolkar123 4 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad it helped!
@danishmalak9221
@danishmalak9221 2 жыл бұрын
Ctrl + F12 🔥. Thank you.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You're welcome!
@rahuldewada2009
@rahuldewada2009 3 жыл бұрын
Hey Tim, For the code formatting we can also use Ctrl + K and Ctrl + D. Appreciate the great video.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome.
@Ethaniel67
@Ethaniel67 2 жыл бұрын
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
@bvandevliet
@bvandevliet 2 жыл бұрын
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!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
That is a nice feature as well.
@danylaws
@danylaws 6 жыл бұрын
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 ! :-)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@dand4485
@dand4485 5 жыл бұрын
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 :)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Nice! Thanks for sharing.
@decisivepro1961
@decisivepro1961 5 жыл бұрын
The last tip is very useful, thanks!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome. Thanks for watching.
@dand4485
@dand4485 5 жыл бұрын
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; } }
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
That is really nice.
@leifbogeisler
@leifbogeisler 2 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad it was so helpful.
@RomanOgorodnyk
@RomanOgorodnyk 4 жыл бұрын
Hi Tim, number 9 is new to me. Thanks about that
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad to help!
@MrMimzoo
@MrMimzoo 4 жыл бұрын
c# interactive window is really nice and I didn't know !
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I'm glad you learned about it.
@Sonny0276
@Sonny0276 6 жыл бұрын
Great Video. Thank you for posting.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@doraechizen84
@doraechizen84 6 жыл бұрын
Now i know there are lots of hidden feature in vs...thank a lots tim corey
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@KaushikGanguly72
@KaushikGanguly72 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Do you mean CTRL + Shift + V?
@Chiramisudo
@Chiramisudo 4 жыл бұрын
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!)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Excellent! I'm glad it was helpful.
@texaslinux
@texaslinux 4 жыл бұрын
I can't believe I didn't know ctrl+T, that is amazing!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad you learned something new.
@fayax
@fayax 4 жыл бұрын
Excellent... I think you just doubled my coding speed.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad I could help!
@SrinubabuRavilla
@SrinubabuRavilla 4 жыл бұрын
Amazing tips.... Thanks Tim
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@MrPrezDev
@MrPrezDev 4 жыл бұрын
*TIP:* You can hold *CTRL+ALT and click* anywhere in the code to place additional cursors in VS2019 at least.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@MrPrezDev
@MrPrezDev 4 жыл бұрын
@@IAmTimCorey My pleasure and thank you for your awesome videos, they are highly appreciated.
@MiskoKatua
@MiskoKatua 3 жыл бұрын
Great one!
@kitsurubami
@kitsurubami 4 жыл бұрын
i was surprised to find out that i actually know a few of these :D
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Awesome!
@ashishsah6967
@ashishsah6967 4 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
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
@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
@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.
@darklen14
@darklen14 4 жыл бұрын
its CTRL +K+D now for format
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for the tip
@MiskoKatua
@MiskoKatua 3 жыл бұрын
Ctrl E+D still works
@amrutkalamkar6217
@amrutkalamkar6217 4 жыл бұрын
Thanks for Very helpful tricks. Didn't knew Ctrl+T
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@yukselaydemir
@yukselaydemir 2 жыл бұрын
In VS 2022 the "Format document on save" option is now available. Instead of using shortcuts you can format the document by saving it.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
That is a nice addition, for sure.
@miltoszoumekas7567
@miltoszoumekas7567 Жыл бұрын
Where is this setting?
@MiskoKatua
@MiskoKatua 3 жыл бұрын
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
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
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
@jgcornell
@jgcornell 5 жыл бұрын
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.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Yeah, I haven't figured out the reason but it seems like half use ED, half use KD.
@KishorTiwari
@KishorTiwari 4 жыл бұрын
Same here
@itsolutionsdev
@itsolutionsdev 4 жыл бұрын
CTRL+R R to rename variables and classes and all its references - very usefull
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I'm glad.
@MohammedDerbashi
@MohammedDerbashi 4 жыл бұрын
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?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
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.
@MsSharayu
@MsSharayu 4 жыл бұрын
Ctrl+E, D is changed to Ctrl+K,D in VS 2019.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for the tip
@MiskoKatua
@MiskoKatua 3 жыл бұрын
Ctrl+E, D still available in 2019 (K,D also works)
@petrutarabuta5617
@petrutarabuta5617 3 жыл бұрын
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.
@crazedprogrammer5825
@crazedprogrammer5825 6 жыл бұрын
dang, i learned alot from this, why can't my guy get more likes here?
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm glad you got a lot out of this.
@GuildOfCalamity
@GuildOfCalamity 3 жыл бұрын
Is there a way to exclude commented code during a search?
@santhoshn3766
@santhoshn3766 4 жыл бұрын
Open .cs file Use Ctrl + G -> Enter the number it will take to the particular line number.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@doubledennis
@doubledennis 6 жыл бұрын
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?
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Not that I know of.
@karabasbarabas2000
@karabasbarabas2000 4 жыл бұрын
One more tip - you can drag a oiece of code to the ToolBox window, and after paste it back somewhere
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
15 Visual Studio Editor Tips including Intellicode and EditorConfig
1:15:01
Top 10 C# Best Practices (plus bonuses)
57:28
IAmTimCorey
Рет қаралды 512 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Design Patterns: Don't Repeat Yourself in C#
53:21
IAmTimCorey
Рет қаралды 174 М.
Refactoring in C# - Improving an Existing Application
1:22:15
IAmTimCorey
Рет қаралды 68 М.
C# Events - Creating and Consuming Events in Your Application
1:09:13
Intro to WebAPI - One of the most powerful project types in C#
1:15:21
How to connect C# to SQL (the easy way)
1:20:40
IAmTimCorey
Рет қаралды 1,1 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН