Quick Review: Snippet Designer

At work, I am a big fan of using snippets for common tasks. Out of laziness, I never re-created them for my home environment. Today though, I decided to do just that. I went into Visual Studio Gallery and searched for “snippet” and found this which got some good reviews:

http://visualstudiogallery.msdn.microsoft.com/B08B0375-139E-41D7-AF9B-FAEE50F68392?SRC=VSIDE

This is pretty easy to use, and works great. There were a few things that weren’t obvious that I wanted to write down.

To use this, you do File –> New:

image

There is a new template category for Snippet Designer. Choose that, and it will open a snippet in an editor – for example:

image

When you want to create a “token”, simply type a $, then a name, and when you type the closing $, it will add it to the list in the bottom. You can then fill in the other details – like the tooltips and the default value.

Next, if you look in the Properties window (hit F4):

image

You can set the author, description, and most importantly the shortcut. The shortcut is what you actually see in the IDE. For example:

image

when I Tab-Tab to use that snippet in the editor, it gives me this template:

image

from here, I can obviously tab through all of the tokens that I set up in the snippet, and hit <Enter> to save the code.

Bottom line, this is a great, really simple snippet editor that works great. By the way, since the default location is already setup:

image

Visual Studio will see the snippet right away and you can start using it immediately. Anyhow, very cool little add-in – I recommend it!

Posted in .NET 3.5, .NET 4.0, ASP.NET, ASP.NET MVC, Best-practices, NETMF, Uncategorized, Visual Studio, WinForms
One comment on “Quick Review: Snippet Designer
  1. Alain BUFERNE says:

    It works like you say but we have access to the Snippet Designer Installed Template with File>New only when no Solution is opened in VS 2010

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2 other followers

%d bloggers like this: