Create custom code snippet in Visual Studio 2008
Asked Answered
E

5

13

Like the title says, how do you create custom code snippets in Visual Studio 2008?

Exercise answered 22/9, 2008 at 20:43 Comment(0)
D
11

Here's a link to a utility for Creating/editing Snippets. It works for more languages than just VB despite the classification in the link.

http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx

Dufour answered 22/9, 2008 at 20:45 Comment(0)
H
16

This was just released too: http://codeplex.com/SnippetDesigner

The Snippet Designer is a plugin which enhances the Visual Studio IDE to allow a richer and more productive code snippet experience...

Features

A Snippet editor integrated inside of the IDE which supports C#, Visual Basic, JavaScript, HTML, XML and SQL

  • Access it by opening any .snippet file or going to File -> New -> File -> Code Snippet File
  • It uses the native Visual Studio code editor so that you can write the snippets in the same enviorment you write your code.
  • It lets you easily mark replacements by a convenient right click menu.
  • It displays properties of the snippet inside the Visual Studio properties window...

A Snippet Explorer tool window to search snippets on your computer.

  • It is located under View -> Other Windows -> Snippet Explorer
  • This tool window contains a code preview window which lets to peek inside the snippet to see what it is without opening the file.
  • Maintains an index of snippets on your computer for quick searching.
  • Provides a quick way to find a code snippet to use, edit or delete...
Hoarding answered 22/9, 2008 at 20:48 Comment(0)
D
11

Here's a link to a utility for Creating/editing Snippets. It works for more languages than just VB despite the classification in the link.

http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx

Dufour answered 22/9, 2008 at 20:45 Comment(0)
I
8

The MSDN links are nice, but sometimes I prefer simple tutorials.

Ite answered 22/9, 2008 at 20:52 Comment(0)
F
4

Tools->Code Snippets Manager

To get your list of directories. Select (or Add) My Code Snippets.

The snippets themselves have to be created as separate files with a .snippet extension.

Here is a tutorial on using and creating them: Code Snippets in Visual Studio

Footboard answered 22/9, 2008 at 20:52 Comment(0)
G
0

See official write-up here:

http://msdn.microsoft.com/en-us/library/ms165392.aspx

Goddamned answered 22/9, 2008 at 20:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.