Snippets expand boilerplate code templates with interactive tab-stops.
Expanding Snippets#
-
Type the trigger prefix (e.g.
stless,for,try) in the editor. -
Select the snippet from the completion list and press
TaborEnter. - The snippet body inserts and focuses the first placeholder (
$1).
Tab-Stop Navigation#
| Key | Action |
|---|---|
Tab |
Move to next placeholder ($2, $3...) |
Shift + Tab | Move to previous placeholder |
Escape |
Cancel snippet session and restore normal cursor |
Navigating past the final placeholder ($0) automatically exits snippet mode.
Placeholder Features#
-
Default Values:
${1:initialValue}fills the placeholder with editable default text. -
Mirrored Stops: Multiple occurrences of the same index (e.g.,
${1:WidgetName}) update simultaneously as you type in one. -
Choice Lists:
${1|optionA,optionB,optionC|}opens a dropdown list of choices on that tab stop. -
Dynamic Variables:
$TM_FILENAME: File name with extension.$TM_FILENAME_BASE: File name without extension.$CURRENT_YEAR: 4-digit current year.$CLIPBOARD: Contents of the system clipboard.
Built-in Flutter / Dart Snippets#
stless: Generates aStatelessWidget.stful: Generates aStatefulWidgetandStateclass.builder: Generates aBuilderwidget.
Next Steps#
- Markdown Live Preview — Render Markdown files.
- Navigation & Quick Open — Keyboard navigation.
