WebStorm 9.0.2 Web Help

Wrapping a Tag. Example of Applying Surround Live Templates

As an example of applying a surround template, let's wrap a piece of XML code with tags.

To surround a code fragment

  1. Open the desired file for editing.
  2. Select a code fragment.
    surroundXML1
  3. Press invocation shortcut Ctrl+Alt+J. WebStorm suggests the following surround templates:
    surroundXML2
  4. Select the tag template from the suggestion list. The code fragment is surrounded with empty tags:
    surroundXML3
  5. The caret rests within the opening one. On typing the tag name in the opening tag, the name is automatically reproduced in the closing tag:
    surroundXML4

See Also

Last modified: 11 December 2014
comments powered by Disqus