views:

95

answers:

7

I have a demo coming up and would rather not type in front of the audience. I figured I could put the code snippets some place and put them in as I go. Now I know I can use Notepad (or pretty much any other text editor) for the purpose but I have a feeling there's something nicer out there. Anybody have any ideas for me?

Ideally I'm looking for something like the Visual Studio toolbox where I can drag text in to set it up and then drag it back into the IDE when I need it.

I tried just dragging the text to the toolbox. It seemed to work but then I closed Visual Studio, put my laptop into standby and powered it back up and everything was gone! Maybe its a VS bug (or a Win 7 bug) or maybe this is how its supposed to work. Either way, I'm looking for something a bit more robust.

+3  A: 

Have you tried just dragging the text to the toolbox? I believe that does exactly what you want.

jcopenha
I can't believe I've never known this feature! I've used VS nearly every working day for more than three years... and I've never known this. Thanks! No more Notepad for temporary snippets!
Stewart
+2  A: 

Here's some information on defining your own code snippets in Visual Studio.

http://blogs.microsoft.co.il/blogs/gilf/archive/2009/01/17/how-to-write-your-own-code-snippets.aspx

Code snippets are inserted typing their keyword, then pressing Tab twice. If you're not familiar with how they work, try using some of the default ones first. Type "prop" then press Tab twice, and VS will generate a Property stub for you, or "mbox" to generate a MessageBox.Show() stub.

pyrochild
+2  A: 

what about using the built in code snippets, creating your own with their own aliases? modify an existing code snippet, and give it an alias of (for example) #demo1

go into your code, type #demo1, press tab and hey presto.

You have your own folder where snippets are installed and anything in there is picked up in eachinstance of visual studio.

have a look at this, and this.

Terry_Brown
A: 

you could write a visual studio macro to do it.

sean riley
+1  A: 

i am using http://www.codeplex.com/SnippetDesigner for exactly your scenario. it's really easy to use. have fun!

A: 

Or a clip manager, like jumpcut on MacOSX. Must be something similar for windoze. http://jumpcut.sourceforge.net/

Brad Cox
+1  A: 

Maybe this is what you're looking for.

http://www.csharper.net/blog/new_version_of_clipboard_manager__1_0_0_6_.aspx

Patrik
That's a neat little plugin.
Chuck Conway