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

  Рет қаралды 106,496

IAmTimCorey

IAmTimCorey

Күн бұрын

Visual Studio is much more than just a text editor. There is a ton of power built into the platform. Before you go out and spend a lot of money on 3rd party tools, you should get to know what is already available to you in Visual Studio. That is why in this video, I am going to show you ten of my favorite features to make your development faster and easier.
Full courses: www.iamtimcorey.com/
Source Code: leadmagnets.app/?Resource=Hid...
Patreon: / iamtimcorey
Newsletter signup: signup.iamtimcorey.com/
Top 10 List
1. Open Containing Folder (right-click on a tab) and Copy Full Path (right-click on a tab)
2. Add suggestions for assemblies and NuGet packages as well as prefer auto-properties - Under Tools - Options - Text Editor - C# - Advanced
3. Go To Definition (F12 or Ctrl+Click) or Go To Implementation (Ctrl+F12)
4. Go To All (Ctrl+T or Ctrl+,)
5. Refactoring (Ctrl+. or Alt+Enter)
6. Code Cleanup (Ctrl+E,D) - more cleanup options under Tools - Options - Text Editor - C# - Code Style - Formatting
7. Interactive Window (under View - Other Windows - C# Interactive)
8. Move Code (Alt+Up/Down Arrow)
9. Show Intellisense (Ctrl+J) or Show Parameter Information (Ctrl+Shift+Space)
10. Multi-Cursor (Shift+Alt+Up/Down Arrow)
User-provided time codes:
0:00 - Overview
1:33 - Right click on a tab - Open Containing Folder to open File Explorer at the file's location
2:19 - Right click on a tab - Copy Full Path to copy the full path of the file
2:57 - Create auto properties when extracting an interface with Quick Actions
4:08 - Suggest uses for types in reference assemblies and NuGet packages with Quick Actions
8:50 - Access implementation using Go To Implementation
11:23 - Do a focused search to find types, lines and other useful things using Go To
18:11 - Built-in refactoring using Quick Actions
25:12 - Easily format using Format Document
27:20 - C# Interactive window (Built-in REPL Editor) for quick testing and scripting
31:02 - Moving whole lines up and down in the text editor
33:05 - Useful IntelliSense shortcuts
35:54 - Multi-line modifications
Shortcuts:
Quick Actions: (Alt + Enter), (Ctrl + .) or (Ctrl + ;)
Go To Implementation: (Ctrl + F12) or (Ctrl + Left click)
Go To: (Ctrl + ,) or (Ctrl + T)
Format Document: (Ctrl + E, D)
Moving whole lines: (Alt + Up Arrow) or (Alt + Down Arrow)
Show IntelliSense: (Ctrl + J)
Show overloads: (Ctrl + Shift + Space)

Пікірлер: 391
@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.
@vahradrimaakeroth3904
@vahradrimaakeroth3904 2 жыл бұрын
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 2 жыл бұрын
Holy wow, you have no idea how much time you will have saved me
@RalfsBalodis
@RalfsBalodis 3 жыл бұрын
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 3 жыл бұрын
Thanks! Someone already beat you to it. I have similar timecodes in the description.
@RalfsBalodis
@RalfsBalodis 3 жыл бұрын
@@IAmTimCorey I noticed. After... :) Still. More videos to go, as I watch them :)
@b0570nk4
@b0570nk4 5 жыл бұрын
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 5 жыл бұрын
Thanks for sharing.
@MiikaKontio
@MiikaKontio 4 жыл бұрын
Control+k+d format document
@dancilman9036
@dancilman9036 3 жыл бұрын
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 3 жыл бұрын
Glad you like them!
@robe5823
@robe5823 5 жыл бұрын
This is an awesome video Tim, thank you for sharing this knowledge and I hope this one blows up for you
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@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.
3 жыл бұрын
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 3 жыл бұрын
Glad you enjoyed it!
@overb
@overb 3 жыл бұрын
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 3 жыл бұрын
Great to hear!
@pierreplourde
@pierreplourde 2 жыл бұрын
Numbers 1, 4, and 10 were brand new to me and #4 is worth its weight in gold!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Awesome!
@L371
@L371 Жыл бұрын
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!
@GrahamStw
@GrahamStw 3 жыл бұрын
*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 3 жыл бұрын
Excellent, thanks for sharing!
@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.
@AnalogGame
@AnalogGame 3 жыл бұрын
Super useful Gems!! Great video as always!
@AnalogGame
@AnalogGame 3 жыл бұрын
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 3 жыл бұрын
Thanks for the Tip.
@azizanhaniff9294
@azizanhaniff9294 3 жыл бұрын
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 3 жыл бұрын
Glad to help!
@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.
@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.
@harag9
@harag9 5 жыл бұрын
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 5 жыл бұрын
Thanks for the suggestion. I'm glad you got something out of this video.
@HieuNguyen-kt9ks
@HieuNguyen-kt9ks 4 жыл бұрын
Hi Tim, Number 7 and 9 are new to me. Thank a lot!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great!
@muhammadzeshawn3883
@muhammadzeshawn3883 5 жыл бұрын
Nice work.. Great video.. I appreciate your work and effort tim, Please keep up the good work..
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you.
@abdelaliboussetta1450
@abdelaliboussetta1450 4 жыл бұрын
Just landed into this channel. first impression : Awesome !
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Welcome! I'm glad you are enjoying the content.
@thoutamdurgaprasad2966
@thoutamdurgaprasad2966 3 жыл бұрын
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 3 жыл бұрын
Glad it was helpful!
@LuigiZambetti
@LuigiZambetti 5 жыл бұрын
Another useful video. Thank you so much Tim.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@mehr52
@mehr52 4 жыл бұрын
Thanks Tim, number 6 in VS 2019 is Ctrl+K, Ctrl+D
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
It depends. It isn't on my default installation. Different setups can have different shortcuts (which is frustrating).
@alexcurtisdev
@alexcurtisdev 5 жыл бұрын
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 5 жыл бұрын
I'm glad you were able to gain some new productivity boosters.
@roycelithgo3968
@roycelithgo3968 4 жыл бұрын
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 4 жыл бұрын
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.
@williamrood8933
@williamrood8933 5 жыл бұрын
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 5 жыл бұрын
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.
@JuanUrbaez
@JuanUrbaez 4 жыл бұрын
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 4 жыл бұрын
I am glad you enjoyed the video.
@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.
@neoanderson7962
@neoanderson7962 4 жыл бұрын
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 4 жыл бұрын
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.
@johnarnold8603
@johnarnold8603 4 жыл бұрын
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 4 жыл бұрын
I am glad you enjoyed the video.
@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.
@MrLuckyalmond
@MrLuckyalmond 3 жыл бұрын
This is so good. Thank you.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome.
@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 4 жыл бұрын
youre pretty old, bru
@codeceps
@codeceps 5 жыл бұрын
Gosh that goto shortcut is pure gold.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I love it. I figured others would too.
@Unordinal
@Unordinal 3 жыл бұрын
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 3 жыл бұрын
Awesome!
@Sonny0276
@Sonny0276 5 жыл бұрын
Great Video. Thank you for posting.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@decisivepro1961
@decisivepro1961 4 жыл бұрын
The last tip is very useful, thanks!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@niyaz8
@niyaz8 5 жыл бұрын
I didn't know about CTRL + J. Thanks Tim! I think I'm going to use it a lot :)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Excellent!
@gakshay9537
@gakshay9537 4 жыл бұрын
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 4 жыл бұрын
I am glad you found them helpful.
@SrinubabuRavilla
@SrinubabuRavilla 4 жыл бұрын
Amazing tips.... Thanks Tim
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@karendoran3692
@karendoran3692 5 жыл бұрын
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 5 жыл бұрын
Custom controls are coming in the future at some point.
@janoslaszlo3272
@janoslaszlo3272 3 жыл бұрын
Ctrl+J was new for me. I'm going to use it from now on.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Great!
@cleversonsutil4495
@cleversonsutil4495 3 жыл бұрын
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 3 жыл бұрын
Same here, really useful feature!
@rem-od5wz
@rem-od5wz 3 жыл бұрын
I learned dotnet core 3 with your video in 40 minutes. Thanks alot.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Great to hear!
@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!
@binamis
@binamis 5 жыл бұрын
Awesome video as always, #6 on mine is Ctrl+k, Ctrl+d.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Yep, there are apparently different shortcut schemes that you can implement.
@aleksandaril
@aleksandaril 3 жыл бұрын
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 3 жыл бұрын
Thanks for sharing.
@RomanOgorodnyk
@RomanOgorodnyk 4 жыл бұрын
Hi Tim, number 9 is new to me. Thanks about that
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad to help!
@alemicuta8star
@alemicuta8star 3 жыл бұрын
37:37 - you can do that with CTRL+ALT and Highlight/Select the text Thank you, your videos are SO helpful! :)
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks for the tip!
@danylaws
@danylaws 5 жыл бұрын
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 5 жыл бұрын
You are welcome.
@onyebuchiboss
@onyebuchiboss 5 жыл бұрын
I did not now about c# intereactive dialog, currently using it at work now. thanks Tim.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Awesome!
@vladimirkozel6397
@vladimirkozel6397 4 жыл бұрын
Tim, thanks, great. I did not know C# interactive, CTRL+. and CTRL+T. Thanks.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@99MrX99
@99MrX99 5 жыл бұрын
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 5 жыл бұрын
Thanks for pointing it out. I don't use F2 because I always found it quirky but it is definitely a hidden gem.
@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!
@ahmetbibi
@ahmetbibi 3 жыл бұрын
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 3 жыл бұрын
Thanks for sharing the tip!
@DK-tr7ir
@DK-tr7ir 5 жыл бұрын
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 5 жыл бұрын
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.
@linux_master_race
@linux_master_race 4 жыл бұрын
I can't believe I didn't know ctrl+T, that is amazing!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad you learned something new.
@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.
@Old.Man.Of.The.Mountain
@Old.Man.Of.The.Mountain 4 жыл бұрын
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 4 жыл бұрын
You are most welcome. Thanks for watching.
@romeoromano3050
@romeoromano3050 4 жыл бұрын
agree!!!
@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.
@amrutkalamkar6217
@amrutkalamkar6217 4 жыл бұрын
Thanks for Very helpful tricks. Didn't knew Ctrl+T
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@DukeJon1969
@DukeJon1969 3 жыл бұрын
very helpful thanks!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Great!
@peteredenburg6464
@peteredenburg6464 5 жыл бұрын
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 5 жыл бұрын
Yep, that's a good one.
@peteredenburg6464
@peteredenburg6464 5 жыл бұрын
I'm glad contribute the other way around for a change.
@parvejsolkar123
@parvejsolkar123 3 жыл бұрын
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 3 жыл бұрын
Glad it helped!
@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.
@joemieszczur9735
@joemieszczur9735 5 жыл бұрын
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 5 жыл бұрын
I'm glad I was able to help you become a lot more efficient in your development.
@danishmalak9221
@danishmalak9221 2 жыл бұрын
Ctrl + F12 🔥. Thank you.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You're welcome!
@RobinHood70
@RobinHood70 5 жыл бұрын
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 5 жыл бұрын
Yep, thanks for pointing that out.
@kitsurubami
@kitsurubami 4 жыл бұрын
i was surprised to find out that i actually know a few of these :D
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Awesome!
@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!
@doraechizen84
@doraechizen84 5 жыл бұрын
Now i know there are lots of hidden feature in vs...thank a lots tim corey
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are 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
@shashikantchitalkar4788
@shashikantchitalkar4788 3 жыл бұрын
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 3 жыл бұрын
Thanks for sharing.
@fayax
@fayax 4 жыл бұрын
Excellent... I think you just doubled my coding speed.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad I could help!
@mutayyab01
@mutayyab01 Жыл бұрын
Amazing 🤩🤩
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@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.
@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!
@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.
@vinodbadawadagi3099
@vinodbadawadagi3099 4 жыл бұрын
thank you bro!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@doubledennis
@doubledennis 5 жыл бұрын
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 5 жыл бұрын
Not that I know of.
@dand4485
@dand4485 4 жыл бұрын
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 4 жыл бұрын
That is really nice.
@RobinHood70
@RobinHood70 5 жыл бұрын
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 5 жыл бұрын
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.
@techdave99
@techdave99 5 жыл бұрын
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 5 жыл бұрын
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).
@MrMimzoo
@MrMimzoo 4 жыл бұрын
c# interactive window is really nice and I didn't know !
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I'm glad you learned about it.
@haozheng8400
@haozheng8400 2 жыл бұрын
Wow! "Ctrl + ." is really powerful!! Thanks for sharing!!! I use "Ctrl + G" almost everyday.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad it was so helpful.
@KaushikGanguly72
@KaushikGanguly72 3 жыл бұрын
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 3 жыл бұрын
Do you mean CTRL + Shift + V?
@JustinMinnaar
@JustinMinnaar 5 жыл бұрын
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 5 жыл бұрын
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.
@petrutarabuta5617
@petrutarabuta5617 3 жыл бұрын
Thanks!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Welcome!
@GuildOfCalamity
@GuildOfCalamity 3 жыл бұрын
Is there a way to exclude commented code during a search?
@dand4485
@dand4485 4 жыл бұрын
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 4 жыл бұрын
Nice! Thanks for sharing.
@zerosandones7547
@zerosandones7547 3 жыл бұрын
can we do format on save on vs 2019 now? or still the extension?
@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.
@viteralex
@viteralex 2 жыл бұрын
Hi Tim. Which keyboard mapping scheme do you use? In my case Ctrl+J doesn't work. Format document is Ctrl+K,D, not Ctrl+E,D. Show parameters is Ctrl+K,P and so on
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
So I found out that my keyboard mapping scheme was an old one carried over from upgrading Visual Studio over and over. I've now set it to the new default in Visual Studio, but it does mean that in this video, the shortcuts may differ a bit from what you have.
@MiikaKontio
@MiikaKontio 4 жыл бұрын
I started using tips you provided here. Very helpful ones for me were "go to" search thingie, move class to a new file and remove non used usings on whole project. Btw does useless usings use memory or other resources on production or does it make visual studio faster or is just a cleaner not to have them?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
They don't hurt anything. Cleaning them up just makes things a bit cleaner.
@rizgarkh
@rizgarkh 4 жыл бұрын
Thank you Time
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@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.
@lexaznaurov5205
@lexaznaurov5205 3 жыл бұрын
One more tip - you can drag a oiece of code to the ToolBox window, and after paste it back somewhere
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks for sharing.
@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.
@crazedprogrammer5825
@crazedprogrammer5825 5 жыл бұрын
dang, i learned alot from this, why can't my guy get more likes here?
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I'm glad you got a lot out of this.
@santhoshn3766
@santhoshn3766 3 жыл бұрын
Open .cs file Use Ctrl + G -> Enter the number it will take to the particular line number.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks for sharing.
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 26 МЛН
A Worlds First On This Top Tier Radio - TIDRadio H3
11:52
Tech Minds
Рет қаралды 16 М.
Why all your classes should be sealed by default in C#
11:43
Nick Chapsas
Рет қаралды 91 М.
Setting Up Our Project: Building a Postman Clone Course
22:49
IAmTimCorey
Рет қаралды 9 М.
What are Closures in C# and why you NEED to know about them
12:01
Nick Chapsas
Рет қаралды 73 М.
30+ String Manipulation Techniques in C#
1:44:07
IAmTimCorey
Рет қаралды 100 М.
Bill Gates demonstrates Visual Basic (1991)
3:00
Crapkai
Рет қаралды 2 МЛН