Snippets are small bits of template code that can be inserted while typing. They show up in your list of content assist items. Snippets are similar to "editor templates" in Eclipse parlance, but can be contributed via script.
Some key items:
- trigger: the text needed to trigger the snippet.
- expansion: the text the trigger will be replaced with. Can contain variables and tab stops.
- scope: the editors and languages in which this snippet will be active
- description: A descriptive text about the snippet. Optional
- category: A name of a category used to group the snippet with other similar snippets. Optional
- icon_path: the path to an icon that represents the snippet. Optional
- tags: keywords that describe the snippet. Used as means to easily filter snippets. Optional
Typing part of the trigger will show the snippet in content assist. If the trigger phrase is unique, typing the whole trigger + the Tab key will automatically insert the snippet into the document, otherwise, you will be prompted to pick one of the available options.
If you instead want to modify an existing piece of content (say to modify the current selection in the editor), you'll want to look at creating a command instead.