Code Snippets rock. I love being able to type "prop" and hit tab 2x in VS 2005 to start stubbing out a property. (My fav is the "switch" shortcut, it just rules).
Another shortcut that rules, but that I hate is "exception". Why do I hate it? Because when I'm typing along and doing a:
Catch(exc...
I expect to be able to hit tab, and have Exception pop up, so'z I can do the following:
Catch(Exception ex)
{
// continue on with life here... }
Only I end up getting:
So, today I decided to customize my snippets.
1) Tools > Code Snippets Manager,
2) Language = C#,
3) Nav to the Visual C# node, then find the exception snippet.
Copy/Paste the Location into Windows Explorer, and then I'm able to modify the existing snippet. (Just change the shortcut in the resultant XML doc...)
I figured that xception would be a good enough shortcut, and would stop me from having collisions due to my lazyness with capitalization.
Save, and voila... "exce" now Intellisenses out to become Exception.
Even better? There's now no possibility of a collision on exception, so even if I type "catch(exception ex)" Intellisense changes it for me as exception no longer exists... (yeayy!)





You know, I love VS2005 and all the editing features, but I feel like I'm getting burned a lot with intellisense (burned = frequent backspacing to correct stuff). So, this is useful to help save some of my user-error created problems.
Coincidentally, while tinkering with code snippets, I saw this page today: http://msdn.microsoft.com/vstudio/downloads/codesnippets/
Posted by: Brian | March 07, 2006 at 01:10 PM