Take the 2-minute tour ×

This may sound like a stupid question but I can't seem to find an answer. For example, take a look at the default div snippet that ships with Visual Studio 2010:

<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <Author>Microsoft Corporation</Author>
    <Description>Markup snippet for a block element</Description>
    <Code Language="html"><![CDATA[<$shortcut$>$selected$$end$</$shortcut$>]]></Code>

How would I use the alternative p shortcut? In IntelliSense, none of the alternatives are available. First of all, I've tried Surround With > HTML > p but since that's not a valid IntelliSense option, it defaults to surrounding with an a tag.

Additionally, I've tried Surround With > HTML > divp, div p, div-p, div:p among others and nothing works, it just defaults to div (and note the first option I wanted to try was div > p but the snippet selector won't allow > as input).

Does anyone know how to use this feature?

share|improve this question
It is an undocumented element, impossible to reliably answer the question. Or to put it another way, don't be surprised that undocumented elements don't work as you hope. –  Hans Passant Sep 1 '11 at 18:49
@Hans that's the conclusion I had come to and was hoping that someone in the 'overflow would have some insight. –  sellmeadog Sep 1 '11 at 22:36

2 Answers 2

up vote 0 down vote accepted

Accepting Hans' comment as the answer.

share|improve this answer

It's now documented. AlternativeShortcuts is used for intellisense when you start typing tags. Still no use with 'Surround With' even in VS 2013.

Quote from the link above:

Notice that the Alternative Shortcuts list includes other HTML elements such as p, h1, h2, and so on. This tells you that the same snippet is invoked by using the shortcuts <div, <p, <h1, and so on, because the corresponding HTML elements all use a similar pattern. Therefore, these elements are grouped together in the Code Snippets Manager.

share|improve this answer

Your Answer


