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

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 391

  • @andrewjarman4999
    @andrewjarman4999 4 года назад +15

    Great video. Another useful one is clipboard history, Ctrl+Shift+V, which shows the last 10 things copied.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад +5

      Did you know Windows has one as well? Win+V

    • @jameslacey3674
      @jameslacey3674 4 года назад +1

      @@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.

  • @RalfsBalodis
    @RalfsBalodis 4 года назад +8

    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 года назад +1

      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 :)

  • @GrahamStw
    @GrahamStw 4 года назад +2

    *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 года назад +2

      Excellent, thanks for sharing!

  • @overb
    @overb 4 года назад +1

    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

  • @pierreplourde
    @pierreplourde 3 года назад +2

    Numbers 1, 4, and 10 were brand new to me and #4 is worth its weight in gold!

  • @JuanUrbaez
    @JuanUrbaez 5 лет назад +2

    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 года назад +1

    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.

  • @MathGeekQ
    @MathGeekQ 4 года назад +3

    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.

  • @vahradrimaakeroth3904
    @vahradrimaakeroth3904 2 года назад +8

    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 года назад +1

      Holy wow, you have no idea how much time you will have saved me

  • @amoswittenbergsmusings
    @amoswittenbergsmusings 4 года назад +2

    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.

  • @roycelithgo3968
    @roycelithgo3968 5 лет назад +2

    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.

  • @johnarnold8603
    @johnarnold8603 5 лет назад +3

    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.

  • @b0570nk4
    @b0570nk4 6 лет назад +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

  • @mehr52
    @mehr52 5 лет назад +4

    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 года назад +3

    CTRL + R, R is one of the best.
    Renames all instances of an identifier.

  • @EriAirlangga
    @EriAirlangga 5 лет назад +3

    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.

  • @DK-tr7ir
    @DK-tr7ir 6 лет назад +1

    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.

  • @Old.Man.Of.The.Mountain
    @Old.Man.Of.The.Mountain 5 лет назад +2

    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.

  • @KelseyThornton
    @KelseyThornton 3 года назад +5

    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 года назад +1

      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.

  • @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!

  • @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.

  • @codeceps
    @codeceps 6 лет назад +2

    Gosh that goto shortcut is pure gold.

    • @IAmTimCorey
      @IAmTimCorey  6 лет назад

      I love it. I figured others would too.

  • @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 :)

  • @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!

  • @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.

  • @williamrood8933
    @williamrood8933 6 лет назад +1

    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.

  • @janoslaszlo3272
    @janoslaszlo3272 4 года назад +5

    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!

  • @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

  • @EricHarmon67
    @EricHarmon67 5 лет назад +1

    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.

  • @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 года назад +1

      Thanks for sharing the tip!

  •  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.

  • @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.

  • @alemicuta8star
    @alemicuta8star 4 года назад +1

    37:37 - you can do that with CTRL+ALT and Highlight/Select the text
    Thank you, your videos are SO helpful! :)

  • @rem-od5wz
    @rem-od5wz 4 года назад

    I learned dotnet core 3 with your video in 40 minutes. Thanks alot.

  • @99MrX99
    @99MrX99 6 лет назад +2

    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 лет назад +1

      Thanks for pointing it out. I don't use F2 because I always found it quirky but it is definitely a hidden gem.

  • @thoutamdurgaprasad2966
    @thoutamdurgaprasad2966 4 года назад +1

    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.

  • @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

  • @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!

  • @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 :)

  • @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.

  • @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

  • @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 лет назад +1

      Yep, thanks for pointing that out.

  • @abdelaliboussetta1450
    @abdelaliboussetta1450 4 года назад +1

    Just landed into this channel. first impression : Awesome !

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      Welcome! I'm glad you are enjoying the content.

  • @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.

  • @AnalogGame
    @AnalogGame 4 года назад +1

    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 года назад +1

      Thanks for the Tip.

  • @vladimirkozel6397
    @vladimirkozel6397 4 года назад +2

    Tim, thanks, great. I did not know C# interactive, CTRL+. and CTRL+T. Thanks.

  • @joemieszczur9735
    @joemieszczur9735 6 лет назад +1

    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.

  • @muhammadzeshawn3883
    @muhammadzeshawn3883 6 лет назад

    Nice work.. Great video.. I appreciate your work and effort tim, Please keep up the good work..

  • @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.

  • @Paolen
    @Paolen 3 года назад +1

    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.

  • @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.

  • @yakovvorontsov62
    @yakovvorontsov62 5 лет назад +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.

  • @MrLuckyalmond
    @MrLuckyalmond 4 года назад +2

    This is so good. Thank you.

  • @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.

  • @shashikantchitalkar4788
    @shashikantchitalkar4788 4 года назад +1

    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

  • @niyaz8
    @niyaz8 6 лет назад

    I didn't know about CTRL + J. Thanks Tim! I think I'm going to use it a lot :)

  • @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;
    }
    }

  • @RawbLV
    @RawbLV 4 года назад +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!

  • @surendrarajpoot1
    @surendrarajpoot1 4 года назад +1

    Awesome options to know, Thank you very much for mining these gems for us.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад +1

      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 года назад +1

      It is on the suggestion list. Thanks!

  • @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).

  • @DanielLiuzzi
    @DanielLiuzzi 4 года назад

    Bonus tip: if you want your Visual Studio shortcuts to be consistent with Visual Studio Code shortcuts, go to Tools > Options > General > Keyboard, select 'Visual Studio Code' in the drop-down list at the top, then click OK (don't click Reset!) Now you no longer need to remember two different shortcuts for every command.

  • @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

  • @JustinMinnaar
    @JustinMinnaar 6 лет назад +1

    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 лет назад +1

      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.

  • @HieuNguyen-kt9ks
    @HieuNguyen-kt9ks 4 года назад

    Hi Tim, Number 7 and 9 are new to me. Thank a lot!

  • @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.

  • @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  Год назад +1

      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.

  • @onyebuchiboss
    @onyebuchiboss 6 лет назад

    I did not now about c# intereactive dialog, currently using it at work now. thanks Tim.

  • @doraechizen84
    @doraechizen84 6 лет назад

    Now i know there are lots of hidden feature in vs...thank a lots tim corey

  • @LuigiZambetti
    @LuigiZambetti 6 лет назад

    Another useful video. Thank you so much Tim.

  • @santhoshn3766
    @santhoshn3766 4 года назад +1

    Open .cs file Use Ctrl + G -> Enter the number it will take to the particular line number.

  • @MrPrezDev
    @MrPrezDev 4 года назад +2

    *TIP:* You can hold *CTRL+ALT and click* anywhere in the code to place additional cursors in VS2019 at least.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад +1

      Thanks for sharing.

    • @MrPrezDev
      @MrPrezDev 4 года назад

      @@IAmTimCorey My pleasure and thank you for your awesome videos, they are highly appreciated.

    • @MiskoKatua
      @MiskoKatua 3 года назад +1

      Great one!

  • @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?

  • @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.

  • @rahuldewada2009
    @rahuldewada2009 3 года назад +1

    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 года назад +1

      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

  • @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.

  • @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 ! :-)

  • @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.

  • @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

  • @charlesgantz5865
    @charlesgantz5865 5 лет назад +1

    These are great tips, but the problem I've always had was that you can get old and gray trying to remember them. If you search for "Cheat Sheet Visual Studio 2017", you'll see a list of the shortcuts. After a while you will remember the ones you use.

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад +1

      I definitely recommend only focusing on the ones you use. I don't remember them all, just the ones I need.

  • @kitsurubami
    @kitsurubami 4 года назад

    i was surprised to find out that i actually know a few of these :D

  • @danishmalak9221
    @danishmalak9221 2 года назад +2

    Ctrl + F12 🔥. Thank you.

  • @markmd9
    @markmd9 4 года назад +4

    You missed out the most important: CTRL+C, CTRL+V

  • @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 года назад +1

      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.

  • @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.

  • @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 года назад +1

      Great. You can also create your own item templates if you don't want to mess with the built-in ones: ruclips.net/video/3uYN3mDFP-o/видео.html

  • @MrMimzoo
    @MrMimzoo 4 года назад +1

    c# interactive window is really nice and I didn't know !

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      I'm glad you learned about it.

  • @karabasbarabas2000
    @karabasbarabas2000 4 года назад

    One more tip - you can drag a oiece of code to the ToolBox window, and after paste it back somewhere

  • @MsSharayu
    @MsSharayu 4 года назад +6

    Ctrl+E, D is changed to Ctrl+K,D in VS 2019.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад +2

      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.

  • @jgcornell
    @jgcornell 5 лет назад +3

    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 лет назад +1

      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 года назад +4

    CTRL+R R to rename variables and classes and all its references - very usefull

  • @decisivepro1961
    @decisivepro1961 5 лет назад

    The last tip is very useful, thanks!

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад

      You are most welcome. Thanks for watching.

  • @Sonny0276
    @Sonny0276 5 лет назад

    Great Video. Thank you for posting.

  • @yukselaydemir
    @yukselaydemir 2 года назад +1

    In VS 2022 the "Format document on save" option is now available. Instead of using shortcuts you can format the document by saving it.

  • @RomanOgorodnyk
    @RomanOgorodnyk 4 года назад

    Hi Tim, number 9 is new to me. Thanks about that

  • @leifbogeisler
    @leifbogeisler 2 года назад +1

    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 года назад +1

      I am glad it was so helpful.

  • @darklen14
    @darklen14 3 года назад +4

    its CTRL +K+D now for format

  • @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?