Hi allWhenever I want to create a code snippet I usually take an already created one and change the XML file to suit my needs.

well NO MORE!!!!

introducing Snippy the Code snippet editor, creating code snippets was never so Easy!!!

let’s check out the tool with a snippet I wrote for a class with one variable including a constructor and a property for that variable.

Example of Snippy the Code Snippets Editor

It’s so easy, you just give it a shortcut to use in Visual Studio, add the literals you want to use and then write thecode you need using the literals. When you are done just save it in your Visual Studio Custom Snippets folder,which is usually :”C:\Documents and Settings\<USERNAME>\My Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets”,

and that’s it. Next time you run Visual Studio type in the shortcut and let the magic begin… :)

the output of this snippet is this:

<?xml version=1.0encoding=utf-8?>

<CodeSnippets xmlns=http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet>

<CodeSnippet Format=1.0.0>







<Description>template for class with one variable</Description>

<Author>Amit Raz</Author>




<Literal Editable=true>


<ToolTip>First member</ToolTip>





<Literal Editable=true>


<ToolTip>type 1</ToolTip>





<Literal Editable=true>








<Object Editable=true>


<ToolTip>Class name</ToolTip>






<Code Language=csharp><![CDATA[public class $ClassName$


private $Type1$ $Member1$; public $Type1$ $MemberPropName$




return $Member1$;



public $ClassName$($Type1$ newMember)


$Member1$ = newMember;






Not very friendly right? let’s just have snippy do all the work…You can download it here:http://www.codeplex.com/snippy/Release/ProjectReleases.aspx?ReleaseId=9316

hope you Enjoy this


Tags :

9 Responses to “How To Create Code Snippets Easily”

  1. music

    Said on January 7, 2008 :

    very interesting.
    i’m adding in RSS Reader

  2. music

    Said on January 30, 2008 :

    What do you mean ?

  3. admin

    Said on February 6, 2008 :

    what do i mean by what?

  4. Zak

    Said on July 25, 2008 :

    Is there a new link to get Snippy?

  5. Amit

    Said on July 25, 2008 :


    I did not know that it is not working. Here is another link


  6. bill

    Said on October 2, 2008 :

    That is a great little tool – nicely done

    Used in vs2008, it works great

    I suggest a right click menu in the code editor window, with the ID items, or drag an ID item from the list to the code editor window

    Also, in VS2008 the form is off a little, had to move things around, not quite enough room left for the code editor

3 Trackback(s)

  1. Apr 17, 2008: 10 Visual Studio Shortcuts You Must Know | Dev102.com
  2. Jun 23, 2010: Short Keys for Visual Studio | C# Guru
  3. Feb 19, 2012: Dev102

Post a Comment