Sublime Text Snippet Generator
Create a .sublime-snippet XML file with trigger, scope and content. Drop into Packages/User/ in Sublime.
—
A Sublime Text snippet in the XML it expects
A Sublime snippet is an XML file with four parts: the content to be inserted, the trigger typed before Tab, the scope where the snippet is available and the description shown in the menu. The format is simple, but it has escaping traps that produce a file the editor silently ignores, with no error message.
Fill in the fields and the page assembles the XML. The content goes inside a CDATA section, which is what lets you write code with angle brackets without escaping anything — and the page handles the one case that still breaks there, which is content containing the section's own closing sequence. The other fields are escaped normally.
Inside the content the editor's placeholders apply: a dollar sign followed by a number marks the cursor stops in order, and the braced form allows default text at each stop. Dollar zero marks where the cursor ends up. The scope is what prevents clutter: a JavaScript snippet declared with no scope starts appearing in plain text, configuration and Markdown files.
Frequently asked questions
Where do I save the file?
How do I find the right scope?
Why does my snippet not trigger?
Related Tools
VS Code Snippet Generator
Build a JSON snippet ready to paste into VS Code *.code-snippets files, with prefix, multi-line body and tabstops $1, $2.
Basic .vimrc Generator
Build a starter .vimrc with colors, line numbers, indentation, search and common shortcuts. A great starting point for newcomers.
.editorconfig Generator
Generate a .editorconfig file with indent_style, charset, end_of_line and trim_trailing_whitespace. Standardizes editors across teams. Everything in your browser.
HTML Preview
Write HTML, CSS and JavaScript and see the rendered result in real time. Isolated sandbox — no code is sent to any server.
Skip Link Snippet
Takes the id of your main content region and returns the anchor plus CSS for a skip link that stays off-screen until it takes focus (WCAG 2.4.1).
Focus-Visible CSS Snippet
Builds a ready-to-paste :focus-visible rule from an outline colour and a thickness in pixels, with 2px offset, for the WCAG 2.4.7 focus indicator.