Originally, I was going to wait until the weekend to implement Jeff Atwood's modest proposal for copy and paste reusibility, but I ended up doing it all last night.
I ended up calling the feature "Auto Comments," and I support four types right now:
- Comment Snippet ID (Guid) - All new snippets are now tagged with a Guid that can be used for search purposes. When this is checked, a comment with the current snippet ID will automatically be inserted above your code snippet when you drag drag drop or copy paste from the snippet toolbar.
- Comment Reference Url - If the snippet has a reference url and this option is enabled, a comment with that reference url will be automatically inserted.
- Comment User - If this option is checked, the current windows user ID will be automatically inserted as a comment.
- Comment Date - If this option is checked, the current date will automatically be inserted as a date time.
I ended up googling comments for all the languages I support. Your snippet must be categorized with a language for the comments to show up. If you choose the category: "Other" or "Text", no comments will appear.
Here's an example of an HTML snippet I drag dropped:
<!-- Snip-It Pro Snippet: 84b29e68-6769-4fbd-ad84-4a557fb565e5 -->
<!-- Inserted By SFLaptop\David -->
<!-- Inserted On Thursday, April 23, 2009 -->
It automatically added the first three lines, which were not part of the snippet.
Here is a C# snippet I favorited on Snipplr: (I favorited it in Snipplr and dragged dropped from Snip-It Pro)
// Snip-It Pro Snippet: fc9c7bc0-6ace-43ef-ac80-6d6d70ea0d0d
// Reference Url: http://snipplr.com/view/4602/enum-property
// Inserted By SFLaptop\David
// Inserted On Thursday, April 23, 2009
public enum CurrActionType
view, edit, create
private CurrActionType currActionType;
public CurrActionType ActionType
currActionType = value;
Anyway, you get the idea by now.
Another related feature that Snip-It Pro always had is that if you copy code from any web page (drag to a folder or New From Clipboard) it will automatically fill out the reference url from where the snippet came from.
The beta is downloadable by clicking here.
Let me know what you think by leaving a comment or sending an email to firstname.lastname@example.org.