Search
Monday, October 20, 2014 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

Sara Ford's VS 2010 Tips presentation, check out the cool tips and analysis!

Jun 30

Written by:
Wednesday, June 30, 2010 8:34 PM  RssIcon

Sara Ford doing 101 Visual Studio Tips in 55mSara Ford is a Visual Studio Master, she is the One to goto for VS tips'n'tricks.  Check out her latest presentation about VS tips and my discussion on some of my favourite tips.  Warning, long, involved and WELL worth the investment of time IMHO!

Sara Ford doing 101 Visual Studio Tips in 55m

If you are a Visual Studio Ninja, or fany yourself a VS guru, chances are good you know who Sara Ford is.  If you're a moderate coder, or just want to learn how to use Visual Studio better, she's someone you do want to get to know.  Check out this latest video about her latest VS tips presentation.

Sara did this presentation earlier this month and she goes through 101 VS tips in 55 minutes!  Ya, really she does!  Well, ok, truth be told, she goes over her own self-set time limit, BUUUUUUT if you REALLY counted the tips, at the 55m she's actually at about 103 , those other ones just didn't make it onto her "cheatsheet" she gave out.  So ya, she really did go through 101 tips in 55m.  I encourage you to check out the vid cause it'll give you a complete coding context on my next analysis on some of my favourites Sara talks about.

* = Shortcuts which aren't default but my custom setting, it's one suggestion in case you're looking for one.

# Title New to VS2010? Shortcut Comments
1 Automatic symbol highliting Y CTRL+SHIFT+Arrow  Put your cursor on a variable, wait a sec, ok 2s, then you'll see all the places that var is used hilighted in light gray.  Visually you can see from a high level and zoom in your focus on what/where you want go next.
2 Navigating back/forward in code   CTRL+-/CTRL+SHIFT+- Let's you go bacvk through "go-back markers" to previous places you just visited.
3 Navigate To Y CTRL+, Can search with pascal casing.  Can't see what you want with Automatic symbol highlighting, use this and use pascalCasing works here, just type out the caps of your var names, try it, you won't be sorry!
4 Window splitting     This tip is part of new windowing functionality (ex multi-monitor support just means you can rip out a CS code window onto another monitor).  If you do this right (Vertically split, New Window, the move it over) let's you conveniently look at the exact same file but in two different windows!  Try that with any other editor.  If you have small files, this has little benefit to you, but if you have HUGE files, then this is awesome!
5 View visible whitepace   CTRL+E+S

This is a toggle setting, meaning the same shortcut turns the setting on/off.  What's this good for?  Do you ever have a situation when you're trying to figure out if you're looking at a SPACE or a TAB char?  Maybe it's in a string, maybe you're trying to format stuff, but either way, it's just NOT coming out correctly?  Chances are you have spaces where you want tabs, or visa versa.  THIS tip clear the air immediately!

I always get this one mixed up with CTRL+E+D, which formats the current doc, but if you're using PowerCommands and have the autoformat on save, it looks like nothing happened when you expected the whitespace chars to come up.  Careful on this one.

6 Box selection/ overwrite Y SHIFT+ALT+Arrow Have you EVER wanted to turn fifteen string variables into StringBuilder variables?  You probably do the cut'n'paste dance right?  NOW you have a faster way, now you select (using shorcuts) the var types you want (works MUCH better when they're grouped together LOL), then....wait for it......(yup, you had up to this point in VS2008, but this is new.......start typing the new var type, and BOOM....VS is typing it out on all the lines you selected!  Ya, it's freaky and I highly suggest you try it out!  I'm using the var datatype as one example, but it's not limited to just this usage, in general it works this way for anything.
8 Remove and Sort unused usings   No, but worthwhile you adding your own. This one is another "pretty up your code" tip and worthwhile after you've been debugging/implementing for a few hours/days on the same file and you've had a few cups of coffee and flying ALL over the code and using VS feature to automagically add using statements at will.  When THAT happens, this tip really cleans things up.
9 Remove project from Start Page Y   Now you can see the Start Page at will (before you could only see it on startup), but before if you wanted to remove projects from the Start Page list, well......you had to play with the registry, or get some other VS plugin that played with the registry for you.  Either way, it was nasty to get rid of solutions/projects from that list.  Now, you can just goto the start page, right mouse click a project, and select Remove From List, POOF!  Gonezo!  Let's you focus on just what you want to focus on.
10 Bookmarks   CTRL+K, CTRL+K Bookmarks allow you to jump around code with BLINDING speed, as long as you have/know your bookmark shortcuts.  These are like the anchor points in VI.  Don't know VI......oh man, talk about Exederin inducing headaches, but now that I know it, I did like the numbered anchor points.  In VS I have shortcuts to goto next/previous bookmark and to toggle the bookmark.  CTRL+* to toggle on/off, then CTRL+Num9 to to fwd and CTRL+NUM7 to go back.  There's a few others, but if you start with these, you'll be flying around multiple files in NO time like Spidey goes from building to building!
11 Type-ahead matching in Intellisense Y   As Intellisense comes up, you're given a HUGE list, but the method/property you want isn't visible, but you KNOW it's there, just down the list a bit.  What do you?  Reach for the mouse if you're in VS 2008, but not in VS 2010!  OH NO!  Just start typing, with CAPS the pascal case upper characters of the method/property and you'll prune down your visbile list faster than you can say "Double-Double!"  Try it out, type out Console.WL and you'll quickly see how this tip will become your new best friend!
12 Suggestion mode in Intellisense Y CTRL+ALT+SPACE Ever have Intellisense popup, then automagically select something you DIDN'T want?  Yup, happens to most of us.  VS now has the Suggestion mode, with the shortcut, you'll get a textbox above the normal Intellisense options where you can continue typing out what you wanted, EVEN IF it's not one of the options given by Intellisense.  In other words, Intellisense is working for you, not the other way around and forcing you to take what it gives you.  Interesting concept, I need to play around more with this one.  The setting does stick in between Intellisense uses.  This will be VERY useful if you're heavily into TDD IMHO.
13 Using a Code Snippet   TAB, TAB You've heard of them, Code Snippets, but never used them?  Oh man, are you missing out!  Code Snippets are a gold mine waiting to be mined!  Just try this out, pretend you want to enter in a new propert, oh just bear with me ok? LOL  Ok, you're there in your code in the right place, ok, type out prop TAB, TAB.......see what just happened, VS typed out the property FOR YOU, along with the backing variable, AND watch what's next, VS is now highlighting the var type where you can change it and any/all applicable usages will change appropariately, type TAB again and you'll cycle to the next option to change, the property name.  This is a HUGELY powerful feature worth exploring more.  Try the for loop one, type out for TAB, TAB, boom you've just elimated most of your future hand strains from typing out for loops from now on!
14 Surround Code Snippets   CTRL+K, CTRL+S Ok, so what about Code Snippets, if you've ALREADY got the code typed out?  Good question, another feature of Code Snippets is the ability to "surround" existing code with a code snippet, these are special kinds of snippets, but that's cool, it's nothing to be afraid of.  Select a line, or two or three, then use the shortcut, and you'll have a short list of things you can surround your selected code with, like a #region, or if statement, or try/false, etc.  This is another gold mine just waiting for you to discover!
15 Incremental Search   CTRL+I (as in uppercase i) You want to search for something, but don't want to bring up the Find dialog?  Sure, use this shortcut and start typing and you'll automagically highlight the next occurance of your search text.  Sweet.  Continue to hit CTRL+I to search for you can even use F3 to continue.  This is one place the pascal casing search doesn't work, if you need to do this, use the Navigate To tip (CTRL+,).
16 Search current word   CTRL+F3 What do you do if you want to look for a specific variable name in your code?  Well, with VS 2010, you can just put your cursor in one instance and just wait for VS to highlight all of them.  hhhmmm What happens if you don't immediately see what you want?  What then?  hhhmm Well, you just hit the shortcut, and SNAP, you're automagically searching your code word that variable.  Did you notice something?  Nowhere did you use your mouse or keyboard to select the entire variable name, OH SNAP!  That's right eh?  Cool eh?  The bonus to this is as you flip from instance to instance of searched text, it's selected so you can easily augment the text with anything you want.
17 Specify which files to Find in   CTRL+SHIFT+F Ok, you probably know about the Find In Files (or at least you will now LOL), but what you may not know is that you can specify WHICH files you want VS to look into.  Ya, if you're looking for a specific variable name, but only in ASPX pages, not in your code behinds or data layers, then open up the Find Options section and type out *.aspx in the Look at these file types area.  Sweet option to help you narrow down your find scope.
18 File Tab Channel   CTRL+ALT+DWN

You ever open up so many files along the top, you kind of lose track?  Using this keyboard shortcut will give you a birds eye view of your open files.  There are TWO caveats though, first, there are no file paths, so if you open up a filename with the same name in two namespaces/projects/etc, you're kind of in the dark as to which one you'll get.  And two, the list is limited to 14 files, how do you know if you've opened more than 14?  Check out the down arrow, if it has a horizontal line above it, that's telling you have more files open than it can handle.  In this case, read the next tip.

19 Closing multiple files at once, selectively   *CTRL+SHIFT+ALT+F4

When you have just waaaaaaaaay too many windows open and want to close some, BUT want to keep a few open, say, 2/3/4/5 but you won't know what they are until you see ALL of them?  Open up Windows, Windows, or create this shortcut keyboard shortcut for it.  This will give you a resizeable windows (which remembers it's size, cool) AND it let's you close just the windows you want.

20 Close All But This   *CTRL+SHIFT_F4 You should set this one up as one of your keyboard shortcuts in your arsenal, it's awesome!  There is NO faster way to focus on the file at hand, than to close EVERYTHING else except for the one you're looking at.
21 Copy Full Path     Ever want to copy the location of where a file is to do something in another tool but could never do it?  Well, if you right mouse click on the file tab, you'll see Copy Full Path and bingo, you have what you need to paste into documentations, or some command line file, or even Windows Explorer.
22 Open Containing Folder/Open Folder in Windows Explorer      If you're looking at doing the former tool (open up Win Explr), then this is actually the fastest way to do it.  Why?  Sometime you JUST DON'T TRUST what you get when you F5 your program.  You want to run it yourself, but how do you navigate 15 dirs down?  haha You DON'T, you use this Open Containing Folder THEN navigate down to the bin, debug/release folder yourself.
23 View two files at once and still get the BIG picture Y   This is probably the easiest tip to use, just click'n'drag the filename tab over to another monitor and boom, you're looking at two files at once!  Sweet.  And, if you're careful with this, you can even open up the same file, rip it off of where it is now, place it on the 2nd monitor and compare pieces of code to copy a pattern for example.
24 Snap windows to VS edges Y   If you like being able to "snap" windows to edges in WIndows 7, you'll LOVE this feature cause you can do the samething in VS 2010!  I don't like this feature in Windows 7, so I have this turned off myself, but that's not to sa you won't like it?
25 How to put the file back home? Y CTRL+double click top Once the files been ripped from it's foundation (DOH! HAHA) how to you get it back home?  Simple, just put it back. OR you could use the CTRL+double clicking in the top filename to go back home.
26 LIFO or FIFO for newly opened files? Y   When you open up a file, WHERE do you expect it to open on the file tab channel?  To the right or to the left?  If you're expecting it on the left, then chances are you're a regular VS user and accustomes to VS.  If you expect file tabs to appear on the right, you were out of luck in VS08 but not in VS2010, look in Options, Documents and the last checkbox, Insert documents to the right of existing tabs and you will hopefully get back what you thought you lost forever.
27 MAXIMIZING your IDE   SHIFT+ALT+ENTER We all KNOW what product we're using right?  VS 2010 I assume? haha  Dumb question right?  Then why are we always looking at the main menu with the control buttons when we don't have to?  Cause you probably didn't know you could get rid of it right?  COOL!  YAAA!  You can remove that top 15pixels or so and use them for coding/IDE/Debugging/etc instead of nothingness!  Moreoever, VS has a few states it saves windowing positions for, and this is one of them.  So the next time you open up, it'll remember your settings!  I use this for ALL my dev now, and for the very few, miniscule times I need to see more, then I know it's one shortcut away.
28 Moving around the Toolbox   CTRL+ARROW You ever try to use the mouse in the toolbox?  Here's a bonus tip, CTRL+ALT+X to show the toolbox, now you can hide it and show it only when you want to see it, not 100% of the time.  But more importantly, how do you flip between groupings within the toolbox, use the shortcut.  Another bonus, NUMPAD / and * will minimize and maximize everything within the toolbox!
29 Seeing more out of your Toolbox     Do you really need to see the names of all the "Common Controls" Microsoft gives you?  Come on, do you really need to see the desriptive Label for a Label?  You can't tell me you couldn't pick out the Button from a picture line up?!  Then why are we always staring at those descriptive labels?  Turn that list, by category, into an icon view (aka not the List View).
30 Skip the VS Start Page and load your last piece of fine work    

I don't care for the Start Page with RSS feends and other marketing fluff.  I just want to continue working where I left off the last time I closed VS.  Tools, Options, Environment, Startup and At startup listbox is your best friend now.  Now, in VS 2010, IF you do this but still want to see the Start Page, check out View, Start Page, you're not missing anything anymore.

31 Fastest way to continue your work?     Open up VS with your last project already loaded!  Look at the previous setting for the option in the listbox.  When you open up VS, your last work will automagically be loaded.  Bonus tip, ALT+F, J and then some # will give you the quikest way to your last 7/8/9/10 opened projects!  This is a quick way to bounce around multiple projects without skipping a beat.
32 Use Solution Folders to hide Projects     You have a program that has 50 projects as part of your solution?  Don't laugh, a company I used to work for, DOES that!  DOH!  Anyways, it was distracting to bounce around the code from layer to layer trying to debug stuff, especially when there is a vertical scroll bar in your project listings.  Ya, there were THAT many.  The solution is to create solution folders which are artificial folders (ie nothing on the file system, just in the XML files) and you can now hide solutions you're not interested in.  Don't worry, those settings are not permenant and do not affect the build or checkins.
33 Type ahead in Solution Explorer     hhhmmmm you KNOW the name of the file you want, but you juuuuust don't see it in the Solution Explorer.  So what?  Start typing it out, you'll navigate to it just similarly to how you would expect CTRL+I to work.  Unfortunately the pascal typing doesn't work here, but hey, this is a step in the right direction for us keyboard junkies.
34 Showing active file in Solution Explorer   *CTRL+ALT+> Do you ever look at a piece of code in a file, and WISH you could just see which layer/project/directory it's in?  Ya, me too, happens all the time.  The quickest way to do this is to use the Track Active Item in Tools, Options, Projects and Solutions.  The caveat to this is, things flip around wildly as you're bouncing around the file tabs.  If that bugs you too much, I have a solution.  Turn the setting off, do all your work, THEN, when you need to find out where that file lives, hit a shortcut key twice, and your Solution Explorer will give you what you want.  Uh, hhmm Peter, WHY TWICE?  Cause the option is a toggle, ya, this one took me a LOOOOOONG time to figure out, it's not a one shot deal, you toggle it on, then off.  If you find a better way (without macros) let me know!
35 Use tracepoints instead of Conole output     Have you ever released code with printf statements?  Console.WriteLines for debugging purposes?  Ya, if you haven't, you're either lieing, or your jr.  Either way, THIS tip is for you!  Using Tracepoints (F9 to set, right click, select When Hit... and put in {varName} and you hopefully not get stung with spitting out debug info to some console on client release builds.
36 Editing variable while debugging     This is one of the most awesome-est parts of the "Integrated" part of IDE!  As your debugging, you can change the runtime value your looking at to test possible conditions you cannot reproduce but are still tasked to deal with (a bug that's unreachable/unreproducable).  This also helps with manipulating testing of edge cases by entering those conditions and testing them out immediately.
37 Making the Intellisense hide itself, but just for a moment.   CTRL while Intellisense is up Ever have Intellisense popup juuuuuuuust as you were looking at the name of variable or method RIGHT UNDERNEATH IT?!  YA, happens to a lot of us.  The fix?  Just hit the CTRL key and Intellisense will be become transparent letting you peek into the code behind it.  SWEEEEEEEEEEET!
38 Smart Tag   CTRL+. And lastly, this tip is worth playing with over and over and over again, it shows off it's usefulness in the code editor, the HTML editor, runtime debugging sessions, it's just plain awesome!  It gives you completel control but yet still letting VS have a bit of AI and help you out!  You want to use File.Copy command but don't have the using System.IO; Smart tag it!  Looking at an exception while debugging but not sure what it is?  Smart tag it!  There are PLENTY of other uses for it, so try it out whenever you see a small red rectangle underneath some code you're looking at.

There you have it, links to Sara's vid, and (what I hope is) an in depth analysis of some of the more useful favourites to me, and soon for you too I hope!  Just cause some of the remaining 63 didn't make the above list doesn't diminish their value, they just don't work for me.  That's NOT to say they won't work for you though!  If you're a keyboard junkie like me, you might like mine above, but if you're a "mouser," then you might find some of the other's more applicable to you.  Hey, that's the beauty of these tips and to a greater extent, the power of Visual Studio's flexibility, it's able to accomodate so many different types of devs, BEAUTIFUL!

Now, it's time to grab a coffee and get coding!

 

Resources:

Channel 9: Sara Ford's 101 Visual Studio Tips in 55 Minutes Challenge (Nic Fillingham)

MSDN: Download Sara's 101 Visual Studio Tips Sheet Here

MSDN: Sara Ford's Weblog

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

4 comment(s) so far...


Re: Sara Ford's VS 2010 Tips presentation, check out the cool tips and analysis!

Hey Peter!

Thanks for the great analysis! Quick and easy summary for folks to follow!

Thanks,
-sara

By sara ford on   Tuesday, July 06, 2010 2:17 PM

Re: Sara Ford's VS 2010 Tips presentation, check out the cool tips and analysis!

Thank you Sara for leaving a comment! Very cool to have you comment and I'm very happy you like the analysis. I just hope it's not too long for people to go through, or at least there's is some humour in there for them to at least enjoy and come back to later. LOL Thanks again and keep up the great work!

By phenry on   Tuesday, July 06, 2010 2:24 PM

Re: Sara Ford's VS 2010 Tips presentation, check out the cool tips and analysis!

CTRL+SHIFT+F3 - should be - CTRL+SHIFT+F
The PowerCommands extension can automatically do format and sort/remove usings on every save.
Thanks for this expanded discussion of the tips.

By Toby on   Thursday, July 15, 2010 2:28 PM

Re: Sara Ford's VS 2010 Tips presentation, check out the cool tips and analysis!

AHA Toby, you're right! DOH! I just updated the page, thanks for the correction and comment!

Ya, PowerCommands can automagically sort/remove usings, but the hiccup there is if you're doing debugging or poking and trying things out, you might get annoyed with always having to re-add using statements (if you're putting in and taking out File for example). It would be COOL IMHO if upon checking in your code, VS automagically reformats and sorts/removes used imports. That is probably the ONE thing I would like VS to have from my Eclipse days (DOH! ya, I said Eclipse DOH! oh man!).

Thanks for the comment Toby and glad I could help out.

By phenry on   Thursday, July 15, 2010 2:33 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement