SnippetCreator - VS Code ExtensionWords From The AuthorTerry Yang I created this extension to address my own needs for efficient code snippet creation and text manipulation. As both the developer and a daily user of this tool, I can personally guarantee its safety and reliability. Every feature has been thoroughly tested in my own workflow, ensuring that Terry's Snippet Creator delivers a seamless and secure editing experience. If you have questions, feedback, or feature requests, feel free to reach out through the GitHub repository. "Build tools you'd trust to use yourself." OverviewTerry's Snippet Creator started as a simple tool to create code snippets in separate files, but has evolved into a powerful text manipulation toolkit. While the name remains Terry's Snippet Creator, it now offers a diverse set of features to enhance your editing workflow in Visual Studio Code. FeaturesSnippet CreationCreate well-formatted code snippets in separate files with ease:
Regex SelectionQuickly select multiple occurrences of text that match a regular expression pattern:
Number Sequence GenerationReplace multiple selections with auto-incremented number sequences:
Mathematical Operations on NumbersPerform calculations on numeric portions of text:
Text AlignmentAlign text based on specified characters or patterns:
HighlightingHighlight different portions of text with vivid colors to improve readability:
Batch Text OperationsStore and replay multiple text replacement operations:
Bracket / Quote Select (
|
| Press | Effect |
|---|---|
| x1 | Selects the text enclosed by the nearest brackets/quotes |
| x2 | Replaces the brackets with "..." (double quotes) |
| x3 | Replaces with (...) (parentheses) |
| x4 | Replaces with [...] (square brackets) |
| x5 | Replaces with {...} (curly braces) |
| x6 | Replaces with <...> (angle brackets) |
| x7 | Removes the brackets entirely, keeping text selected |
| x8 | Applies "..." around the remembered positions |
| ... | Continues cycling through bracket types |
| x14 | Restores original brackets and cursor position |
Example — starting with cursor at | inside 'cd ef':
"ab 'cd| ef' gh" (initial state)
"ab '<cd ef>' gh" (x1 — selected)
"ab "<cd ef>" gh" (x2 — double quotes)
"ab (<cd ef>) gh" (x3 — parentheses)
"ab [<cd ef>] gh" (x4 — square brackets)
"ab {<cd ef>} gh" (x5 — curly braces)
"ab <<cd ef>> gh" (x6 — angle brackets)
"ab <cd ef> gh" (x7 — brackets removed)
"ab "<cd ef>" gh" (x8 — double quotes re-added)
...
"ab 'cd| ef' gh" (x14 — restored)
Multiple cursors are supported: each cursor independently finds and cycles through the nearest brackets around it.
HTML Tag Select (Alt+Q)
Cycle through HTML tag selection states surrounding the cursor, allowing you to select content, remove tags, or select the entire element.
Place your cursor inside or near any HTML tag, then press Alt+Q repeatedly:
| Press | Effect |
|---|---|
| x1 | Selects the text between the opening and closing HTML tags |
| x2 | Removes the opening and closing tags entirely, keeping the inner text selected |
| x3 | Restores the HTML tags and selects the entire HTML block (including the tags) |
| x4 | Restores the original cursor position and clears the selection state |
Example — starting with cursor at | inside <div>C|ontent</div>:
<div>Content</div> (initial state)
<div><Content></div> (x1 — selects "Content")
<Content> (x2 — removes tags)
<<<div>Content</div>>> (x3 — restores tags and selects everything)
...
<div>C|ontent</div> (x4 — restored)
This feature properly handles nested tags and automatically skips void elements (like <img>, <br>, <input>) when searching for the matching pairs. Multiple cursors are fully supported, securely managing offset changes even when editing elements of varying lengths!
Getting Started
- Install the extension from the VS Code Marketplace
- Access features through the command palette (
Ctrl+Shift+PorCmd+Shift+Pon Mac) - Use keyboard shortcuts for frequently used operations
Keyboard Shortcuts
| Feature | Windows/Linux |
|---|---|
| Select by Regex | Ctrl+Alt+S |
| Text Alignment | Ctrl+Alt+R |
| Number Sequence | Ctrl+Shift+N |
| Math Operations | Ctrl+Shift+M |
| Add Highlight | Ctrl+Alt+7 |
| Add a tabstop | Ctrl+Shift+X |
| Add a multi-choice tabstop | Ctrl+Shift+Alt+X |
| Save Current Snippet | Ctrl+Shift+Z |
| Line Operations | Alt+L |
| Bracket / Quote Select | Ctrl+Q |
| HTML Tag Select | Alt+Q |
Use the command palette for other features. In the command palette, type "SnippetCreator" to see all available commands.
Known Issues
When clearing highlights, you may need switch to a different editor tab and back to see the changes. I have not yet found a way to force the editor to refresh the highlights.
License
WTFPL (What The Fuck Public License) - Use at your own risk. No warranties or guarantees are provided. By using this extension, you agree to the terms of the WTFPL.






