Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

Did you know... How to browse code snippets and add new ones - #106

All code snippets are found in the Code Snippet Manager.  It is found at Tools - Code Snippet Manager.  If you are using the default general settings, you can use Ctrl+K, Ctrl+B to bring up the dialog box. 

IMO, the most useful aspect of this dialog is to browse through your current snippets to learn what the "shortcuts" are to quickly insert the snippet into the editor (yesterday's tip).

Additionally, this is where you add (a directory of snippets) and import (a single or multiple-selected snippets to a specified folder via the Import Code Snippet Dialog).

Code Snippet Manager display the C# "for" snippet

I circled the Language combo box to mention that you should always check there to see what type of snippets you are browsing.  The Code Snippet Manager Language combo box is a MRU, meaning that the last set of snippets you looked at (let's say XML) will come up the next time you bring up the dialog.  For me as a tester, it was critical that i always confirmed where i was at before using the dialog.  So maybe I don't need to give out this warning, but old habits die hard, even after a couple of years.

Technorati tags: ,
Posted: Thursday, December 13, 2007 3:00 AM by saraford

Comments

Sherry said:

Hi, The menu option for Code Snippet Manager is missing on my machine. I'm running VSTS 2008 test edition.

I found this forum post that says the menu disappears sometimes and use Tools>Customize>Commands to add to a command bar: http://www.msdner.com/dev-archive/46/5-20-468786.shtm

# December 13, 2007 10:43 AM

J. Michael Palermo IV said:

Sara,

Keep the great tips coming.  By the way, I plan on updating www.GotCodeSnippets.net with VS2008 options soon.  Cheers!

Michael

# December 13, 2007 4:25 PM

Brian said:

Is there a way to add directories for additional languages? I'd like to add snippets for javascript, html, etc.

# December 28, 2007 1:28 PM

Секреты Visual Studio said:

Список всех шаблонов можно найти в Code Snippet Manager (Диспетчер фрагментов кода). Чтобы открыть этот

# March 25, 2009 3:25 AM
New Comments to this post are disabled
Page view tracker