Snippet Enumeration Macro

Inspired by my recent post on C# code snippets, I found a little console app by Francesco Balena* that enumerates all the snippets on your system along with their shortcut text.

I improved his console app and turned it into a convenient IDE macro along the lines of my keyboard shortcut enumerating IDE macro:

Code Snippet enumeration macro screenshot

Download the Snippet List Macro (3kb ZIP)

I found out the hard way that the snippet manager writes all of its changes to the registry. So I use the registry to enumerate all possible snippet paths (this picks up all the per-system snippets and per-user snippets) and also to locate the snippet XML index file that cross-references all the physical paths.

The macro defaults to enumerating the C# snippets, but you can change the _Lang variable to enumerate any available snippet library: VB, C#, J#**, and Xml.

This macro only works in Visual Studio 2005, obviously. Here's how to run it:

  1. go to Tools - Macros - IDE
  2. create a new Module named "Snippets" under "MyMacros"
  3. paste the macro code into the module
  4. close the macro IDE window
  5. go to Tools - Macros - Macro Explorer
  6. A new macro named "List" will be under "Snippets." Double-click it to run.
  7. The macro will take a minute or so to write a HTML file to your My Documents file, and open that HTML file in the IDE.

* One of my earliest coding heroes!

** Does anyone actually use J#? C'mon. Seriously.

Related posts

I Fight For The Users

I Fight For The Users

If you haven’t been able to keep up with my blistering pace of one blog post per year, I don’t blame you. There’s a lot going on right now. It’s a busy time. But let’s pause and take a moment to celebrate that Elon Musk

By Jeff Atwood ·
Comments
Updating The Single Most Influential Book of the BASIC Era

Updating The Single Most Influential Book of the BASIC Era

In a way, these two books are responsible for my entire professional career. With early computers, you didn’t boot up to a fancy schmancy desktop, or a screen full of apps you could easily poke and prod with your finger. No, those computers booted up to the command line.

By Jeff Atwood ·
Comments
To Serve Man, with Software

To Serve Man, with Software

I didn’t choose to be a programmer. Somehow, it seemed, the computers chose me. For a long time, that was fine, that was enough; that was all I needed. But along the way I never felt that being a programmer was this unambiguously great-for-everyone career field with zero downsides.

By Jeff Atwood ·
Comments
The Raspberry Pi Has Revolutionized Emulation

The Raspberry Pi Has Revolutionized Emulation

very geek goes through a phase where they discover emulation. It’s practically a rite of passage. I think I spent most of my childhood – and a large part of my life as a young adult – desperately wishing I was in a video game arcade. When I finally obtained my

By Jeff Atwood ·
Comments

Recent Posts

Stay Gold, America

Stay Gold, America

We are at an unprecedented point in American history, and I'm concerned we may lose sight of the American Dream.

By Jeff Atwood ·
Comments
The Great Filter Comes For Us All

The Great Filter Comes For Us All

With a 13 billion year head start on evolution, why haven’t any other forms of life in the universe contacted us by now? (Arrival is a fantastic movie. Watch it, but don’t stop there – read the Story of Your Life novella it was based on for so much

By Jeff Atwood ·
Comments
I Fight For The Users

I Fight For The Users

If you haven’t been able to keep up with my blistering pace of one blog post per year, I don’t blame you. There’s a lot going on right now. It’s a busy time. But let’s pause and take a moment to celebrate that Elon Musk

By Jeff Atwood ·
Comments
The 2030 Self-Driving Car Bet

The 2030 Self-Driving Car Bet

It’s my honor to announce that John Carmack and I have initiated a friendly bet of $10,000* to the 501(c)(3) charity of the winner’s choice: By January 1st, 2030, completely autonomous self-driving cars meeting SAE J3016 level 5 will be commercially available for passenger use

By Jeff Atwood ·
Comments