Sara Ford points to the release of Snippet Designer by Matthew Manela.
Snippets are a remarkably cool productivity tool within Visual Studio. I say "remarkable", because many people don't even know they exist!
It's great to have a UI over the top of the snippet XML files, which are a little painful to edit by hand. Snippet Designer lets you select a section of code, and export it to the designer to create a snippet:
(I had to cheat to get the screenshot of the menu... anyone know how to do that?)
Then you're dropped into the Snippet Explorer's designer surface, where you have three or four simple steps:
Then simply save the snippet into your snippets directory inside My Documents (the default location is probably right), and now you can use your snippet when editing code.
Type the shortcut string (mine was 'fow'):
Press "Tab" "Tab":
And you end up in the first replacement variable, with the default value entered. Over-write the text with what it should be, and press Tab to jump to the next replacement. Continue pressing tab until everything is correct, and press Enter. You'll jump to the middle of the replacement text:
The snippet file is just XML, so you can edit it directly, or copy it to other computers easily.
There are a lot of snippets installed out of the box, you can browse them using the old Code Snippets Manager (under the Tools menu), or using the new Snippets Explorer installed by the Snippets Designer (under View -> Other Windows).
I'll be showing off the Snippets support in future Visual Studio tips n tricks talks. If you're interested in more tips, I have a Visual Studio 2008 series on this blog, or you can visit Sara Ford's blog.
Previous:
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.